﻿<!DOCTYPE html>
<html lang="en">

<head>
	<title>CZURPluginDemo</title>
</head>

<BODY>
	<div>
		<p>
		<div style="background:#cdc8c8;float:left;width:40%;height:100%">
			<CENTER><canvas style="background:black;with:400px;height:300px" id="mframe" width="640"
					height="480"></canvas><br>
				<CENTER><canvas style="background:black;with:320px;height:180px" id="sframe" width="640"
						height="360"></canvas><br>
					<CENTER><canvas style="background:black;with:320px;height:180px" id="irframe" width="640"
							height="360"></canvas><br>
						<CENTER><canvas style="background:black" id="base64img" width="240px"
								height="120px"></canvas><br>
							<CENTER><canvas style="background:black" id="base64img2" width="240px"
									height="120px"></canvas><br>
								<CENTER><textarea id="TextArea1"
										style="background:white; width:500px; height:200px"></textarea>
		</div>

		<div style="background:white;float:right;width:55%; height:100%; border:1px solid #999;padding:3px;">

			<font color="#FF0000" size="2">连接服务操作: </font><br>
			<input type="button" name="btn" value="连接指令服务器" onclick='connect_cmd_svc()'>
			<input type="button" name="btn" value="连接主头服务器" onclick='connect_mc_svc()'>
			<input type="button" name="btn" value="连接副头服务器" onclick='connect_sc_svc()'>
			<input type="button" name="btn" value="连接红外摄像头服务器" onclick='connect_ir_svc()'><br>
			<input type="button" name="btn" value="测试断开连接" onclick='disconnect_svc()'><br>
			<hr>

			<font color="#00AA00" size="3">SDK授权码</font>
			<input type="text" name="license" id="license" size="100" value=""><br>
			<hr>

			<input type="button" name="btn" value="查询SDK版本" onclick='CZUR_ID_GetVersion()'>
			<input type="text" name="sdkver" id="sdkver" size="20" value="">
			<input type="button" name="btn" value="查询匹配机型" onclick='CZUR_ID_QueryMatchModel()'>
			<input type="text" name="matchmodel" id="matchmodel" size="30" value="">
			<input type="button" name="btn" value="查询设备ID" onclick='CZUR_ID_QueryDeviceID()'>
			<input type="text" name="deviceid" id="deviceid" size="30" value="">
			<hr>

			<font color="#FF0000" size="2">初始化操作</font><br>
			<input type="button" name="btn" value="初始化CZURPlugin" onclick='CZUR_ID_Initialize()'>
			<input type="button" name="btn" value="清除CZURPlugin" onclick='CZUR_ID_Deintialize()'>
			<hr>


			<font color="#00AA00" size="2">主头分辨率</font><select id="mcwh" name="mcwh">
				<option>3264*2448</option>
				<option>2592*1944</option>
				<option>2048*1536</option>
				<option>1600*1200</option>
				<option>1536*1152</option>
				<option>1280*960</option>
				<option>800*600</option>
				<option>640*480</option>
			</select>
			<input type="button" name="btn" value="设置主头预览分辨率" onclick='CZUR_SetMCPreviewResolution()'><br>
			<font color="#00AA00" size="2">副头分辨率</font><select id="scwh" name="scwh">
				<option>1024*576</option>
				<option>960*540</option>
				<option>854*480</option>
				<option>640*360</option>
			</select>
			<input type="button" name="btn" value="设置副头预览分辨率" onclick='CZUR_SetSCPreviewResolution()'>
			<hr>

			<input type="button" name="btn" value="获取设备型号" onclick='CZUR_ID_GetDeviceModel()'>
			<input type="text" name="devmodel" id="devmodel" value="">
			<input type="button" name="btn" value="获取设备ID" onclick='CZUR_ID_GetDeviceID()'>
			<input type="text" name="devid" id="devid" value=""><br>
			<font color="###00AA00" size="2">摄像头类型</font><select id="devtype" name="devtype">
				<option>主摄像头</option>
				<option>副摄像头</option>
				<option>红外摄像头</option>
			</select>
			<input type="button" name="btn" value="打开摄像头" onclick='CZUR_ID_OpenDevice()'>
			<input id="a4wide" type="checkbox" onclick="CZUR_ID_SetA4Wide()" />
			<font color="###00AA00" size="2">A4拍摄幅面</font>
			<input type="button" name="btn" value="关闭摄像头" onclick='CZUR_ID_CloseDevice()'><br>
			<hr>

			<font color="###00AA00" size="2">设置图像处理分辨率</font>
			<input type="text" name="procwidth" id="procwidth" size="30" value="0">
			<input type="text" name="procheight" id="procheight" size="30" value="0">
			<input type="button" name="btn" value="设置分辨率" onclick='CZUR_ID_SetResolution()'><br>

			<font color="###00AA00" size="2">主摄像头亮度(-128~128)，0表示恢复默认亮度</font>
			<input type="text" name="brightness" id="brightness" size="30" value="0">
			<input type="button" name="btn" value="亮度调节" onclick='CZUR_ID_SetBrightness()'><br>

			<font color="###00AA00" size="2">主摄像头对比度(5~20)，10表示恢复默认对比度</font>
			<input type="text" name="contrast" id="contrast" size="30" value="10">
			<input type="button" name="btn" value="对比度调节" onclick='CZUR_ID_SetContrast()'><br>

			<font color="###00AA00" size="2">扫描幅面(仅支持Shine A3系列型号)</font>
			<font color="###00AA00" size="2">幅面类型</font><select id="scanwide" name="scanwide">
				<option>A4幅面</option>
				<option>A3幅面</option>
			</select>
			<input type="button" name="btn" value="设置扫描幅面" onclick='CZUR_ID_SetScanWide()'><br>
			<font color="###00AA00" size="2">限定拍照生成的JPG图像大小KB(0取消限定)</font>
			<input type="text" name="limitsize" id="limitsize" size="30" value="0">
			<input type="button" name="btn" value="限定JPG图像大小" onclick='CZUR_ID_SetJpgMaxSize()'>
			<hr>

			<font color="#FF0000" size="2">图像处理参数设置</font><br>
			<font color="###00AA00" size="2">主头图像旋转</font><select id="rotateangle" name="rotateangle"
				onchange="CZUR_ID_SetAngle()">
				<option>0°</option>
				<option>90°</option>
				<option>180°</option>
				<option>270°</option>
			</select>
			<font color="###00AA00" size="2">主头纸张处理方式</font><select id="paperproc" name="paperproc"
				onchange="CZUR_ID_SetProcessType()">
				<option>不处理</option>
				<option>手动框选裁剪</option>
				<option>自动裁剪黑边</option>
				<option>曲面展平</option>
				<option>展平拆分左右页</option>
				<option>展平平分左右页</option>
				<option>拆分后保留左页</option>
				<option>拆分后保留右页</option>
			</select>
			<font color="###00AA00" size="2">副头纸张处理方式</font><select id="paperproc2" name="paperproc2"
				onchange="CZUR_ID_SetProcessType2()">
				<option>不处理</option>
				<option>手动框选裁剪</option>
			</select>
			<input id="turndetect" type="checkbox" onclick="CZUR_ID_SetTurnDetect()" />
			<font color="###00AA00" size="2">翻页检测</font>
			<input id="pagefill" type="checkbox" onclick="CZUR_ID_SetPageFill()" />
			<font color="###00AA00" size="2">残缺图像补全</font>
			<input id="edgerepair" type="checkbox" checked="checked" onclick="CZUR_ID_SetEdgeRepair()" />
			<font color="###00AA00" size="2">修复残留黑边</font>
			<input id="whitetransparent" type="checkbox" onclick="CZUR_ID_SetWhiteTransparent()" />
			<font color="###00AA00" size="2">白背景转透明</font>
			<hr>


			<font color="#FF0000" size="2">拍照功能</font><br>
			<font color="###00AA00" size="2">摄像头类型</font><select id="grabdevtype" name="grabdevtype">
				<option>主摄像头</option>
				<option>副摄像头</option>
				<option>红外摄像头</option>
			</select>
			<font color="###00AA00" size="2">图像保存名称(支持BMP、JPG、PNG、TIFF、PDF)</font>
			<input type="text" name="grabimage" id="grabimage" size="30" value="d:\1.jpg"><br>
			<font color="###00AA00" size="2">DPI</font>
			<input type="text" name="grabdpi" id="grabdpi" size="5" value="0">
			<font color="###00AA00" size="2">色彩模式</font><select id="grabcolor" name="grabcolor">
				<option>彩色</option>
				<option>彩色优化</option>
				<option>灰度</option>
				<option>黑白</option>
				<option>证件底纹</option>
				<option>白纸印章</option>
				<option>自动优化</option>
			</select>
			<input id="grabround" type="checkbox" />
			<font color="###00AA00" size="2">圆角留白</font>
			<input id="grabadjust" type="checkbox" />
			<font color="###00AA00" size="2">方向自动调整</font>
			<input id="grabbcr" type="checkbox" />
			<font color="###00AA00" size="2">识别条码</font>
			<input id="grabbpd" type="checkbox" />
			<font color="###00AA00" size="2">检测空白页</font>
			<font color="###00AA00" size="2">JPG压缩质量(0~100)</font>
			<input type="text" name="jpgquality" id="jpgquality" size="5" value="75">
			<font color="###00AA00" size="2">TIFF压缩方式</font><select id="tiffcompress" name="tiffcompress">
				<option>无压缩</option>
				<option>G4</option>
				<option>LZW</option>
				<option>JPEG</option>
			</select>
			<br><input type="button" name="btn" value="抓取图像文件" onclick='CZUR_ID_GrabImage()'>
			<input type="button" name="btn" value="抓取BASE64数据" onclick='CZUR_ID_GrabBase64()'>
			<hr>

			<font color="#FF0000" size="2">合成PDF功能</font><br>
			<font color="###00AA00" size="2">图像文件名称1</font>
			<input type="text" name="pdfimage" id="pdfimage" value="d:\1.jpg"><br>
			<font color="###00AA00" size="2">图像文件名称2</font>
			<input type="text" name="pdfimage2" id="pdfimage2" value="d:\2.jpg"><br>
			<font color="###00AA00" size="2">图像文件名称2</font>
			<input type="text" name="pdfimage3" id="pdfimage3" value="d:\3.jpg"><br>
			<font color="###00AA00" size="2">PDF文件名称</font>
			<input type="text" name="pdffile" id="pdffile" value="d:\1.pdf">
			<input type="button" name="btn" value="合成PDF" onclick='CZUR_ID_ImageToPDF()'>
			<input type="button" name="btn" value="合成PDF(多文件)" onclick='CZUR_ID_ImageToPDFEx()'>
			<input type="button" name="btn" value="删除多文件" onclick='CZUR_ID_DeleteFiles()'>
			<hr>


			<font color="#FF0000" size="2">录像功能</font><br>
			<font color="###00AA00" size="2">摄像头类型</font><select id="recordDevtype" name="recordDevtype">
				<option>主摄像头</option>
				<option>副摄像头</option>
				<option>红外摄像头</option>
			</select>
			<font color="###00AA00" size="2">录像文件名称</font>
			<input type="text" name="recordFile" id="recordFile" value="d:\1.mp4">
			<font color="###00AA00" size="2">录像分辨率</font><select id="recordResolution" name="recordResolution"
				onchange="ChangeRecordResolution()">
				<option>1920*1080</option>
				<option>1280*720</option>
				<option>自定义</option>
			</select>
			<input type="text" style="display:none" name="recordWidth" id="recordWidth" value="">
			<input type="text" style="display:none" name="recordHeight" id="recordHeight" value=""><br>
			<input type="button" name="btn" value="开始录像" onclick='CZUR_ID_StartRecord()'>
			<input type="button" name="btn" value="停止录像" onclick='CZUR_ID_StopRecord()'><br>
			<hr>

			<font color="#FF0000" size="2">文本水印功能</font><br>
			<font color="###00AA00" size="2">水印位置</font><select id="wmpos" name="wmpos">
				<option>左上</option>
				<option>右上</option>
				<option>左下</option>
				<option>右下</option>
				<option>居中</option>
			</select>
			<font color="###00AA00" size="2">水印类型</font><select id="wmtype" name="wmtype">
				<option>拍照水印</option>
			</select>
			<font color="###00AA00" size="2">旋转角度</font>
			<input type="text" name="wmangle" id="wmangle" size="5" value="0">
			<font color="###00AA00" size="2">颜色RGB</font>
			<input type="text" name="wmred" id="wmred" size="3" value="255">
			<input type="text" name="wmgreen" id="wmgreen" size="3" value="0">
			<input type="text" name="wmblue" id="wmblue" size="3" value="0">
			<font color="###00AA00" size="2">透明度(0~255)</font>
			<input type="text" name="wmalpha" id="wmalpha" size="3" value="255">
			<br>
			<font color="###00AA00" size="2">水印大小(像素单位)</font>
			<input type="text" name="wmsize" id="wmsize" size="5" value="80">
			<font color="###00AA00" size="2">水印内容</font>
			<input type="text" name="wmtext" id="wmtext" size="15" value="CZUR SDK">
			<input id="wmts" type="checkbox" />
			<font color="###00AA00" size="2">附加时间戳</font>
			<select id="tsformat" name="tsformat">
				<option>年/月/日 时:分:秒</option>
				<option>月/日/年 时:分:秒</option>
				<option>日/月/年 时:分:秒</option>
			</select>
			<br><input type="button" name="btn" value="添加水印" onclick='CZUR_ID_WaterMark_Add()'>
			<input type="button" name="btn" value="清除水印" onclick='CZUR_ID_WaterMark_Clear()'><br>
			<hr>

			<font color="#FF0000" size="2">背景透明功能</font><br>
			<font color="###00AA00" size="2">源JPG图像名称</font>
			<input type="text" name="srcJpg" id="srcJpg" value="d:\1.jpg">
			<font color="###00AA00" size="2">转换后PNG图像名称</font>
			<input type="text" name="dstPng" id="dstPng" value="d:\1.png">
			<input type="button" name="btn" value="开始转换" onclick='CZUR_ID_WhiteCvTransparent()'><br>
			<hr>

			<font color="#FF0000" size="2">人脸对比功能</font><br>
			<font color="###00AA00" size="2">人脸图像文件名称(支持JPG格式)</font>
			<input type="text" name="faceimage" id="faceimage" value="d:\1.jpg"><br>
			<font color="###00AA00" size="2">人脸对比超时时间（单位秒）</font>
			<input type="text" name="facetimeout" id="facetimeout" value="10"><br>
			<input type="button" name="btn" value="开始人脸对比" onclick='CZUR_ID_Start_Face_Match()'>
			<input type="button" name="btn" value="使用base64开始人脸对比（请先点击读取身份证信息）" onclick='CZUR_ID_Start_Face_Match2()'>
			<input type="button" name="btn" value="停止人脸对比" onclick='CZUR_ID_Stop_Face_Match()'><br>
			<font color="###00AA00" size="2">活体检测超时时间（单位秒）</font>
			<input type="text" name="livetimeout" id="livetimeout" value="10"><br>
			<input type="button" name="btn" value="开始活体检测" onclick='CZUR_ID_Start_Face_Live()'>
			<input type="button" name="btn" value="停止活体检测" onclick='CZUR_ID_Stop_Face_Live()'>
			<hr>

			<font color="#FF0000" size="2">读卡器功能</font><br>
			<font color="###00AA00" size="2">图像保存名称</font>
			<input type="text" name="idimage" id="idimage" size="10" value="d:\1.jpg">
			<font color="#00AA00" size="2">纸张类型</font><select id="idpaper" name="idpaper">
				<option>B5纸张</option>
				<option>A4纸张</option>
				<option>证件尺寸</option>
			</select>
			<font color="#00AA00" size="2">排列顺序</font><select id="iddir" name="iddir">
				<option>左右排列</option>
				<option>上下排列</option>
			</select>
			<input type="button" name="btn" value="合成身份证正反面" onclick='CZUR_ID_GetIDCardImage()'>
			<input type="button" name="btn" value="读取身份证信息" onclick='CZUR_ID_GetIDCardOption()'>
			<input type="button" name="btn" value="读取社保卡信息" onclick='CZUR_ID_GetSSCOption()'><br>
			<input type="button" name="btn" value="基于加密机读社保卡信息步骤1" onclick='CZUR_ID_GetSSCOption1()'><br>
			<input type="button" name="btn" value="基于加密机读社保卡信息步骤2" onclick='CZUR_ID_GetSSCOption2()'><br>
			<input type="text" name="jiamiji" id="idjiamiji" size="10" value="">
			<input type="button" name="btn" value="基于加密机读社保卡信息步骤3" onclick='CZUR_ID_GetSSCOption3()'><br>
			<hr>

			<font color="#FF0000" size="2">OCR功能</font><br>
			<font color="###00AA00" size="2">图片文件1名称</font>
			<input type="text" name="ocrimage1" id="ocrimage1" value="">
			<font color="###00AA00" size="2">图片文件2名称</font>
			<input type="text" name="ocrimage2" id="ocrimage2" value="">
			<font color="###00AA00" size="2">图片文件3名称</font>
			<input type="text" name="ocrimage3" id="ocrimage3" value=""><br>
			<font color="###00AA00" size="2">文档保存名称</font>
			<input type="text" name="ocrdoc" id="ocrdoc" value="d:\1.pdf">
			<input id="withsheet" type="checkbox" />
			<font color="###00AA00" size="2">是否带表格</font>
			<font color="###00AA00" size="2">文档幅面</font><select id="psm" name="psm">
				<option>图像尺寸</option>
				<option>自动检测</option>
				<option>A3</option>
				<option>A4</option>
				<option>A5</option>
				<option>B3</option>
				<option>B4</option>
				<option>B5</option>
			</select><br>
			<input type="button" name="btn" value="文档识别(扩展接口)" onclick='CZUR_ID_OCR_DocumentEx()'><br>
			<input type="button" name="btn" value="识别图像返回文本结果" onclick='CZUR_ID_OCR_Text()'><br>
			<input type="button" name="btn" value="文档识别多文件测试" onclick='CZUR_ID_OCR_TextEx()'><br>
			<font color="###00AA00" size="2">图片文件名称</font>
			<input type="text" name="ocrimage2" id="ocrimage2" value="">
			<font color="###00AA00" size="2">识别类型</font><select id="ocrtype" name="ocrtype">
				<option>驾驶证</option>
				<option>行驶证</option>
				<option>护照</option>
				<option>港澳通行证</option>
			</select>
			<input type="button" name="btn" value="证件识别" onclick='CZUR_ID_OCR_Paperwork()'><br>
			<hr>

			<font color="#FF0000" size="2">条码识别功能</font><br>
			<font color="###00AA00" size="2">图像文件名称(支持JPG格式)</font>
			<input type="text" name="bcrimage" id="bcrimage" value="d:\1.jpg">
			<input type="button" name="btn" value="开启条码识别" onclick='CZUR_ID_BCR_Start()'>
			<input type="button" name="btn" value="停止条码识别" onclick='CZUR_ID_BCR_Stop()'>
			<hr>

			<font color="#FF0000" size="2">签名板功能</font><br>
			<font color="###00AA00" size="2">待确认文件名称(支持JPG、PNG、BMP、PDF)，仅签批一体机支持</font>
			<input type="text" name="spfile" id="spfile" size="10" value="d:\1.jpg"></br>
			<input type="button" name="btn" value="打开签名板" onclick='CZUR_ID_SP_OpenDevice()'>
			<input type="button" name="btn" value="关闭签名板" onclick='CZUR_ID_SP_CloseDevice()'>
			<input type="button" name="btn" value="清空签名" onclick='CZUR_ID_SP_Clear()'><br>
			<font color="###00AA00" size="2">签名图像保存名称(支持JPG、PNG、BMP)</font>
			<input type="text" name="spimage" id="spimage" size="10" value="d:\1.jpg">
			<input type="button" name="btn" value="保存签名图像文件" onclick='CZUR_ID_SP_SaveImageFile()'>
			<input type="button" name="btn" value="获取签名BASE64数据" onclick='CZUR_ID_SP_GetJpgBase64()'><br>
			<hr>

			<font color="#FF0000" size="2">评价器功能</font><br>
			<font color="###00AA00" size="2">超时时间</font>
			<input type="text" name="evatimeout" id="evatimeout" size="10" value="15">
			<input type="button" name="btn" value="开始评价" onclick='CZUR_ID_SP_Evaluate()'>
			<hr>

			<font color="#FF0000" size="2">指纹功能</font><br>
			<input type="button" name="btn" value="打开指纹设备" onclick='CZUR_ID_FP_OpenDevice()'>
			<input type="button" name="btn" value="关闭指纹设备" onclick='CZUR_ID_FP_CloseDevice()'><br>

			<input type="radio" name="FPsaveImage" value="1" checked>不保存指纹图像<br>
			<input type="radio" name="FPsaveImage" value="2">保存指纹图像文件
			<input type="text" name="fpimage" id="fpimage" size="10" value="d:\1.jpg"><br>
			<input type="radio" name="FPsaveImage" value="3">保存JPG(BASE64)图像数据<br>
			<input type="button" name="btn" value="开启指纹特征数据采集" onclick='CZUR_ID_FP_StartFeature()'>
			<input type="button" name="btn" value="停止指纹特征数据采集" onclick='CZUR_ID_FP_StopFeature()'><br>
			<hr>

			<font color="#FF0000" size="2">密码键盘功能</font><br>
			<input type="button" name="btn" value="开始密码输入" onclick='CZUR_ID_PK_OpenDevice()'>
			<input type="button" name="btn" value="停止密码输入" onclick='CZUR_ID_PK_CloseDevice()'>
			<hr>

			<font color="#FF0000" size="2">获取文件base64</font><br>
			<input type="text" name="getfile" id="getfile" value="d:\1.jpg"><br>
			<input type="button" name="btn" value="获取文件base64" onclick='CZUR_ID_GetFileBase64()'>
			<hr>

			<font color="#FF0000" size="2">文件相关操作</font><br>
			<font color="#FF0000" size="2">文件名称(绝对路径)</font>
			<input type="text" name="Checkfile" id="Checkfile" value="d:\1.jpg">
			<input type="button" name="btn" value="检查文件是否存在" onclick='CZUR_ID_CheckFile()'><br>
			<font color="#FF0000" size="2">文件夹名称</font>
			<input type="text" name="CheckFolder" id="CheckFolder" value="d:\123">
			<input type="button" name="btn" value="检查文件夹是否存在" onclick='CZUR_ID_CheckFolder()'><br>
			<font color="#FF0000" size="2">文件后缀名</font>
			<input type="text" name="GetFilesUnderFolderType" id="GetFilesUnderFolderType" value="JPG">
			<font color="#FF0000" size="2">文件夹名称</font>
			<input type="text" name="GetFilesUnderFolder" id="GetFilesUnderFolder" value="d:\">
			<input type="button" name="btn" value="获取文件夹中的指定类型文件" onclick='CZUR_ID_GetFilesUnderFolder()'>
			<hr>

			<font color="#FF0000" size="2">HTTP上传功能</font><br>
			<font color="###00AA00" size="2">本地文件名称</font>
			<input type="text" name="httpfile" id="httpfile" value="">
			<font color="###00AA00" size="2">服务器保存名称</font>
			<input type="text" name="httpname" id="httpname" value=""><br>
			<font color="###00AA00" size="2">Http URL</font>
			<input type="text" name="httpurl" id="httpurl" value="">
			<font color="###00AA00" size="2">属性名称</font>
			<input type="text" name="httpopt" id="httpopt" value="">
			<br><input type="button" name="btn" value="开始HTTP上传" onclick='CZUR_ID_Http_Create()'>
			<input type="button" name="btn" value="停止HTTP上传" onclick='CZUR_ID_Http_Delete()'><br>
			<hr>

			<font color="#FF0000" size="2">多目标裁剪功能</font><br>
			<font color="###00AA00" size="2">图片文件名称</font>
			<input type="text" name="mocimage" id="mocimage" value="">
			<font color="###00AA00" size="2">目标图片命名前缀</font>
			<input type="text" name="mocprefix" id="mocprefix" size="8" value="image">
			<font color="###00AA00" size="2">目标图片起始序号</font>
			<input type="text" name="mocnumber" id="mocnumber" size="5" value="1">
			<font color="###00AA00" size="2">目标图片保存路径</font>
			<input type="text" name="mocpath" id="mocpath" value="">
			<br><input type="button" name="btn" value="多目标裁剪" onclick='CZUR_ID_MultiObj_Clip()'>
			<hr>

			<font color="#FF0000" size="2">文件（文件夹）选择功能，仅自启动版本Plugin支持该功能</font><br>
			<input type="button" name="btn" value="选择文件夹" onclick='CZUR_ID_SelectFolder()'>
			<input type="button" name="btn" value="选择文件" onclick='CZUR_ID_SelectFile()'>
			<hr>
		</div>
		</p>
	</div>

	<script type="text/javascript">

		var m_cav_frame = document.getElementById("mframe");
		var m_ctx_frame = m_cav_frame.getContext("2d");
		var m_img_frame = new Image();

		var s_cav_frame = document.getElementById("sframe");
		var s_ctx_frame = s_cav_frame.getContext("2d");
		var s_img_frame = new Image();

		var ir_cav_frame = document.getElementById("irframe");
		var ir_ctx_frame = ir_cav_frame.getContext("2d");
		var ir_img_frame = new Image();

		//显示jpg(BASE64编码)图像数据
		var j_cav_base64 = document.getElementById("base64img");
		var j_ctx_base64 = j_cav_base64.getContext("2d");
		var j_img_base64 = new Image();

		//显示jpg(BASE64编码)图像数据
		var j_cav_base642 = document.getElementById("base64img2");
		var j_ctx_base642 = j_cav_base642.getContext("2d");
		var j_img_base642 = new Image();

		var txtlog = document.getElementById("TextArea1");

		//记录主头处理方式
		var m_process_type = 0;
		//记录副头处理方式，0(不处理)、1(手动框选裁剪)、2(人脸对比)
		var s_process_type = 0;

		//标记当前是否按下鼠标左键
		var is_down_m = false;
		//记录主头手动框选裁剪得矩形框
		var m_left = 0.2 * m_cav_frame.width;
		var m_top = 0.2 * m_cav_frame.height;
		var m_right = 0.8 * m_cav_frame.width;
		var m_bottom = 0.8 * m_cav_frame.height;

		//标记当前是否按下鼠标左键
		var is_down_s = false;
		//记录副头需要绘制的矩形框坐标
		var s_left = 0.2 * s_cav_frame.width;
		var s_top = 0.2 * s_cav_frame.height;
		var s_right = 0.8 * s_cav_frame.width;
		var s_bottom = 0.8 * s_cav_frame.height;

		//记录主头自动裁剪边框坐标
		var m_x1 = 0, m_y1 = 0, m_x2 = 0, m_y2 = 0, m_x3 = 0, m_y3 = 0, m_x4 = 0, m_y4 = 0;

		//记录副头人脸检测区域坐标
		var s_x1 = 0, s_y1 = 0, s_x2 = 0, s_y2 = 0, s_x3 = 0, s_y3 = 0, s_x4 = 0, s_y4 = 0;

		//是否绘制主头视频画面
		var is_draw_m_frame = false;
		//是否绘制副头视频画面
		var is_draw_s_frame = false;
		//
		var is_draw_ir_frame = false;

		//主头通道信息
		var ws_mc = null;
		var mc_svc_port = 9999;
		var mc_svc_connect = false;

		//副头通道信息
		var ws_sc = null;
		var sc_svc_port = 10001;
		var sc_svc_connect = false;

		//红外摄像头通道信息
		var ws_ir = null;
		var ir_svc_port = 10002;
		var ir_svc_connect = false;

		//指令通道信息
		var ws_cmd = null;
		var cmd_svc_port = 25014;
		var cmd_svc_connect = false;

		//记录录像时摄像头序号
		var record_camera_index = 0;

		//记录身份证头像数据
		var head_base64 = null;

		function disconnect_svc() {
			ws_mc.close();
			ws_sc.close();
			ws_ir.close();
			ws_cmd.close();
		}

		window.onbeforeunload = function (e) {
			ws_mc.close();
			ws_sc.close();
			ws_ir.close();
			ws_cmd.close();
			return 1;
		}

		m_cav_frame.onmousedown = function (e) {
			if (is_draw_m_frame) {
				if (1 == m_process_type) {
					is_down_m = true;
					m_left = e.offsetX;
					m_top = e.offsetY;
				}
			}
		}

		m_cav_frame.onmouseup = function (e) {
			if (is_draw_m_frame) {
				if (is_down_m && 1 == m_process_type) {
					is_down_m = false;

					//设置手动框选裁剪，格式：{"id": 19, "type": 纸张处理方式, "left": left位置, "top": top位置, "right": right位置, "bottom": bottom位置}
					var left = 1.0 * m_left / m_cav_frame.width;
					var top = 1.0 * m_top / m_cav_frame.height;
					var right = 1.0 * m_right / m_cav_frame.width;
					var bottom = 1.0 * m_bottom / m_cav_frame.height;

					var cmd = '{\"id\": 19, \"type\": 1, \"left\": ' + left + ', \"top\": ' + top + ', \"right\": ' + right + ', \"bottom\": ' + bottom + '}';
					ws_cmd.send(cmd);
				}
			}
		}

		m_cav_frame.onmousemove = function (e) {
			if (is_draw_m_frame) {
				if (is_down_m && 1 == m_process_type) {
					m_right = e.offsetX;
					m_bottom = e.offsetY;
					m_ctx_frame.drawImage(m_img_frame, 0, 0, m_cav_frame.width, m_cav_frame.height);
					DrawRect(0);
				}
			}
		}

		s_cav_frame.onmousedown = function (e) {
			if (is_draw_s_frame) {
				if (1 == s_process_type) {
					is_down_s = true;
					s_left = e.offsetX;
					s_top = e.offsetY;
				}
			}
		}

		s_cav_frame.onmouseup = function (e) {
			if (is_draw_s_frame) {
				if (is_down_s && 1 == s_process_type) {
					is_down_s = false;

					//设置手动框选裁剪，格式：{"id": 21, "type": 纸张处理方式, "left": left位置, "top": top位置, "right": right位置, "bottom": bottom位置}
					var left = 1.0 * s_left / s_cav_frame.width;
					var top = 1.0 * s_top / s_cav_frame.height;
					var right = 1.0 * s_right / s_cav_frame.width;
					var bottom = 1.0 * s_bottom / s_cav_frame.height;

					var cmd = '{\"id\": 21, \"type\": 1, \"left\": ' + left + ', \"top\": ' + top + ', \"right\": ' + right + ', \"bottom\": ' + bottom + '}';
					ws_cmd.send(cmd);
				}
			}
		}

		s_cav_frame.onmousemove = function (e) {
			if (is_draw_s_frame) {
				if (is_down_s && 1 == s_process_type) {
					s_right = e.offsetX;
					s_bottom = e.offsetY;
					s_ctx_frame.drawImage(s_img_frame, 0, 0, s_cav_frame.width, s_cav_frame.height);
					DrawRect(1);
				}
			}
		}

		function disconnect_cmd() {
			ws_cmd.close();
		}

		function connect_more() {
			for (var i = 0; i < 10; i++) {

				setTimeout(function () {

					var url = "ws://127.0.0.1:" + mc_svc_port + "/";

					if ('WebSocket' in window) {
						ws_mc = new WebSocket(url);
					}
					else if ('MozWebSocket' in window) {
						ws_mc = new MozWebSocket(url);
					}
					else {
						alert("浏览器不支持WebSocket");
					}

					mcWebSocketEvent();
				}, i * 1000);
			}
		}

		function DrawRect(index) {
			//主头区域
			if (index == 0) {
				m_ctx_frame.shadowBlur = 5;
				m_ctx_frame.shadowColor = "rgba(0,0,0,0.5)";
				m_ctx_frame.strokeStyle = "#FF0000";
				m_ctx_frame.lineWidth = 2;
				m_ctx_frame.beginPath();
				m_ctx_frame.rect(m_left, m_top, m_right - m_left, m_bottom - m_top);
				m_ctx_frame.stroke();
			}
			else //副头区域
			{
				s_ctx_frame.shadowBlur = 5;
				s_ctx_frame.shadowColor = "rgba(0,0,0,0.5)";
				s_ctx_frame.strokeStyle = "#FF0000";
				s_ctx_frame.lineWidth = 2;
				s_ctx_frame.beginPath();
				s_ctx_frame.rect(s_left, s_top, s_right - s_left, s_bottom - s_top);
				s_ctx_frame.stroke();
			}
		}

		function DrawMLine() {
			m_ctx_frame.shadowBlur = 5;
			m_ctx_frame.shadowColor = "rgba(0,0,0,0.5)";
			m_ctx_frame.strokeStyle = "#00FF00";
			m_ctx_frame.lineWidth = 2;
			m_ctx_frame.beginPath();
			m_ctx_frame.moveTo(m_x1, m_y1);
			m_ctx_frame.lineTo(m_x2, m_y2);
			m_ctx_frame.lineTo(m_x3, m_y3);
			m_ctx_frame.lineTo(m_x4, m_y4);
			m_ctx_frame.lineTo(m_x1, m_y1);
			m_ctx_frame.stroke();
		}

		function DrawSLine() {
			s_ctx_frame.shadowBlur = 5;
			s_ctx_frame.shadowColor = "rgba(0,0,0,0.5)";
			s_ctx_frame.strokeStyle = "#00FF00";
			s_ctx_frame.lineWidth = 2;
			s_ctx_frame.beginPath();
			s_ctx_frame.moveTo(s_x1, s_y1);
			s_ctx_frame.lineTo(s_x2, s_y2);
			s_ctx_frame.lineTo(s_x3, s_y3);
			s_ctx_frame.lineTo(s_x4, s_y4);
			s_ctx_frame.lineTo(s_x1, s_y1);
			s_ctx_frame.stroke();
		}


		function connect_mc_svc() {
			if (mc_svc_connect == true) {
				alert("已连接主头服务器");
				return;
			}

			var url1 = "wss://127.0.0.1:" + mc_svc_port + "/";
			var url2 = "ws://127.0.0.1:" + mc_svc_port + "/";
			var url = "";

			url = url || ('https:' == document.location.protocol ? url1 : url2);

			if ('WebSocket' in window) {
				ws_mc = new WebSocket(url);
			}
			else if ('MozWebSocket' in window) {
				ws_mc = new MozWebSocket(url);
			}
			else {
				alert("浏览器不支持WebSocket");
			}
			mcWebSocketEvent();
		}

		function mcWebSocketEvent() {
			ws_mc.onopen = function () {
				mc_svc_connect = true;
				txtlog.value = "成功连接主头服务器\r\n" + txtlog.value;
			}

			ws_mc.onclose = function () {
				is_draw_m_frame = false;
				mc_svc_connect = false;
				txtlog.value = "与主头服务器连接中断\r\n" + txtlog.value;
			}

			ws_mc.onmessage = function (e) {
				if (is_draw_m_frame) {
					m_img_frame.crossOrigin = 'anonymous';
					m_img_frame.src = 'data:image/jpeg;base64,' + e.data;

					m_img_frame.onload = function (e) {
						m_ctx_frame.drawImage(m_img_frame, 0, 0, m_cav_frame.width, m_cav_frame.height);

						if (1 == m_process_type) {
							DrawRect(0);
						}
						else if (2 == m_process_type) {
							DrawMLine();
						}
					}
				}
			}
		}

		function connect_sc_svc() {
			if (sc_svc_connect == true) {
				alert("已连接副头服务器");
				return;
			}

			var url1 = "wss://127.0.0.1:" + sc_svc_port + "/";
			var url2 = "ws://127.0.0.1:" + sc_svc_port + "/";
			var url = "";

			url = url || ('https:' == document.location.protocol ? url1 : url2);

			if ('WebSocket' in window) {
				ws_sc = new WebSocket(url);
			}
			else if ('MozWebSocket' in window) {
				ws_sc = new MozWebSocket(url);
			}
			else {
				alert("浏览器不支持WebSocket");
			}
			scWebSocketEvent();
		}

		function connect_ir_svc() {
			if (ir_svc_connect == true) {
				alert("已连接红外摄像头服务器");
				return;
			}

			var url1 = "wss://127.0.0.1:" + ir_svc_port + "/";
			var url2 = "ws://127.0.0.1:" + ir_svc_port + "/";
			var url = "";

			url = url || ('https:' == document.location.protocol ? url1 : url2);

			if ('WebSocket' in window) {
				ws_ir = new WebSocket(url);
			}
			else if ('MozWebSocket' in window) {
				ws_ir = new MozWebSocket(url);
			}
			else {
				alert("浏览器不支持WebSocket");
			}
			irWebSocketEvent();
		}

		function irWebSocketEvent() {
			ws_ir.onopen = function () {
				ir_svc_connect = true;
				txtlog.value = "成功连接红外摄像头服务器\r\n" + txtlog.value;
			}

			ws_ir.onclose = function () {
				is_draw_ir_frame = false;
				ir_svc_connect = false;
				txtlog.value = "与红外摄像头服务器连接中断\r\n" + txtlog.value;
			}

			ws_ir.onmessage = function (e) {
				if (is_draw_ir_frame) {
					ir_img_frame.crossOrigin = 'anonymous';
					ir_img_frame.src = 'data:image/jpeg;base64,' + e.data;

					ir_img_frame.onload = function (e) {
						ir_ctx_frame.drawImage(ir_img_frame, 0, 0, ir_cav_frame.width, ir_cav_frame.height);

						if (1 == s_process_type) //手动框选裁剪，绘制裁剪的矩形区域
						{
							DrawRect(1);
						}
						else if (2 == s_process_type) //人脸对比，绘制脸部矩形区域
						{
							DrawSLine();
						}
					}
				}
			}
		}

		function scWebSocketEvent() {
			ws_sc.onopen = function () {
				sc_svc_connect = true;
				txtlog.value = "成功连接副头服务器\r\n" + txtlog.value;
			}

			ws_sc.onclose = function () {
				is_draw_s_frame = false;
				sc_svc_connect = false;
				txtlog.value = "与副头服务器连接中断\r\n" + txtlog.value;
			}

			ws_sc.onmessage = function (e) {
				if (is_draw_s_frame) {
					s_img_frame.crossOrigin = 'anonymous';
					s_img_frame.src = 'data:image/jpeg;base64,' + e.data;

					s_img_frame.onload = function (e) {
						s_ctx_frame.drawImage(s_img_frame, 0, 0, s_cav_frame.width, s_cav_frame.height);

						if (1 == s_process_type) //手动框选裁剪，绘制裁剪的矩形区域
						{
							DrawRect(1);
						}
						else if (2 == s_process_type) //人脸对比，绘制脸部矩形区域
						{
							DrawSLine();
						}
					}
				}
			}
		}

		function connect_cmd_svc() {
			if (cmd_svc_connect == true) {
				alert("已连接指令服务器");
				return;
			}

			var url1 = "wss://127.0.0.1:" + cmd_svc_port + "/";
			var url2 = "ws://127.0.0.1:" + cmd_svc_port + "/";
			var url = "";

			url = url || ('https:' == document.location.protocol ? url1 : url2);

			if ('WebSocket' in window) {
				ws_cmd = new WebSocket(url);
			}
			else if ('MozWebSocket' in window) {
				ws_cmd = new MozWebSocket(url);
			}
			else {
				alert("浏览器不支持WebSocket");
			}

			cmdWebSocketEvent();
		}

		function cmdWebSocketEvent() {
			ws_cmd.onopen = function () {
				cmd_svc_connect = true;
				txtlog.value = "成功连接指令服务器\r\n" + txtlog.value;
			}

			ws_cmd.onclose = function () {
				cmd_svc_connect = false;
				txtlog.value = "与指令服务器连接中断\r\n" + txtlog.value;
			}

			ws_cmd.onmessage = function (e) {
				var jsonObj = window.JSON.parse(e.data);
				switch (jsonObj.id) {
					//视频帧准备好
					case 119:
						{
							CZUR_ID_GetFileBase64_Response(jsonObj);
						}
						break;
					case 331: {
						CZUR_ID_DataReady_Response(jsonObj);
					}
						break;
					//删除本地文件反馈
					case 41: {
						CZUR_ID_DeleteFile_Response(jsonObj);
					}
						break;

					//处理json数据包失败反馈
					case 0: {
						var error = jsonObj.error;

						switch (error) {
							case 3: {
								txtlog.value = "系统内存不足，无法处理当前指令\r\n" + txtlog.value;
							} break;

							case 5: {
								txtlog.value = "无效的json指令格式\r\n" + txtlog.value;
							} break
						}
					}
						break;

					//初始化CZURPlugin环境反馈
					case 2: {
						CZUR_ID_Initialize_Response(jsonObj);
					}
						break;

					//清除CZURPlugin环境反馈
					case 4: {
						m_process_type = 0;
						is_draw_m_frame = false;
						m_ctx_frame.fillStyle = "#000000";
						m_ctx_frame.beginPath();
						m_ctx_frame.fillRect(0, 0, m_cav_frame.width, m_cav_frame.height);
						m_ctx_frame.closePath();

						s_process_type = 0;
						is_draw_s_frame = false;
						s_ctx_frame.fillStyle = "#000000";
						s_ctx_frame.beginPath();
						s_ctx_frame.fillRect(0, 0, s_cav_frame.width, s_cav_frame.height);
						s_ctx_frame.closePath();

						is_draw_ir_frame = false;
						ir_ctx_frame.fillStyle = "#000000";
						ir_ctx_frame.beginPath();
						ir_ctx_frame.fillRect(0, 0, ir_cav_frame.width, ir_cav_frame.height);
						ir_ctx_frame.closePath();

						document.getElementById("paperproc").selectedIndex = 0;
						document.getElementById("paperproc2").selectedIndex = 0;
						document.getElementById("rotateangle").selectedIndex = 0;
						document.getElementById("turndetect").checked = 0;

						CZUR_ID_Deintialize_Response(jsonObj);
					}
						break;

					//获取设备型号反馈
					case 6: {
						CZUR_ID_GetDeviceModel_Response(jsonObj);
					}
						break;

					//获取设备ID反馈
					case 8: {
						CZUR_ID_GetDeviceID_Response(jsonObj);
					}
						break;

					//打开设备反馈
					case 10: {
						CZUR_ID_OpenDevice_Response(jsonObj);
					}
						break;

					//关闭设备反馈
					case 12: {
						CZUR_ID_CloseDevice_Response(jsonObj);
					}
						break;

					//拍照保存图像文件反馈
					case 14: {
						CZUR_ID_GrabImage_Response(jsonObj);
					}
						break;

					//设置分辨率反馈
					case 16: {
						CZUR_ID_SetResolution_Response(jsonObj);
					}
						break;

					//设置旋转角度反馈
					case 18: {
						CZUR_ID_SetAngle_Response(jsonObj);
					}
						break;

					//设置主头纸张处理方式反馈
					case 20: {
						CZUR_ID_SetProcessType_Response(jsonObj);
					}
						break;

					//设置副头处理方式反馈
					case 22: {
						CZUR_ID_SetProcessType2_Response(jsonObj);
					}
						break;

					//设置翻页检测反馈
					case 24: {
						CZUR_ID_SetTurnDetect_Response(jsonObj);
					}
						break;

					//检测到翻页或硬拍得反馈
					case 25: {
						var state = jsonObj.state;

						switch (state) {
							case 1: {
								txtlog.value = "已检测到硬拍工作\r\n" + txtlog.value;
							} break;

							case 2: {
								txtlog.value = "已检测到翻页工作\r\n" + txtlog.value;
							} break;
						}

						//触发拍照
						CZUR_ID_GrabImage();
					}
						break;

					//获取预览分辨率反馈
					case 27: {
						var error = jsonObj.error;

						switch (error) {
							case 0: {
								txtlog.value = "设置预览分辨率成功\r\n" + txtlog.value;
							} break;

							case 8: {
								txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
							} break;

							case 11: {
								txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
							} break;

							case 12: {
								txtlog.value = "摄像头已打开，无法设置\r\n" + txtlog.value;
							} break;

							case 16: {
								txtlog.value = "无效的预览分辨率\r\n" + txtlog.value;
							} break;
						}
					}
						break;

					//开启HTTP上传反馈
					case 29: {
						CZUR_ID_Http_Create_Response(jsonObj);
					}
						break;

					//停止HTTP上传反馈
					case 31: {
						CZUR_ID_Http_Delete_Response(jsonObj);
					}
						break;

					//添加水印反馈
					case 33: {
						CZUR_ID_WaterMark_Add_Response(jsonObj);
					}
						break;

					//清除水印反馈
					case 35: {
						CZUR_ID_WaterMark_Clear_Response(jsonObj);
					}
						break;

					//多目标裁剪反馈
					case 43: {
						CZUR_ID_MultiObj_Clip_Response(jsonObj);
					}
						break;

					//读取身份证信息反馈
					case 45: {
						CZUR_ID_GetIDCardOption_Response(jsonObj);
					}
						break;

					//读取身份证信息合成图片反馈
					case 47: {
						CZUR_ID_GetIDCardImage_Response(jsonObj);
					}
						break;

					//读取社保卡反馈
					case 49: {
						CZUR_ID_GetSSCOption_Response(jsonObj);
					}
						break;

					//合成PDF反馈
					case 51: {
						CZUR_ID_ImageToPDF_Response(jsonObj);
					}
						break;

					//多文件合成PDF反馈
					case 160: {
						CZUR_ID_ImageToPDF_Response(jsonObj);
					}
						break;

					//多文件删除
					case 162: {
						CZUR_ID_DeleteFiles_Response(jsonObj);
					}
						break;

					//打开密码键盘反馈
					case 53: {
						CZUR_ID_PK_OpenDevice_Response(jsonObj);
					}
						break;

					//关闭密码键盘反馈
					case 55: {
						CZUR_ID_PK_CloseDevice_Response(jsonObj);
					}
						break;

					//自动裁边反馈消息，用于绘制矩形框
					case 56: {
						if (2 == m_process_type) {
							m_x1 = m_cav_frame.width * jsonObj.x1;
							m_y1 = m_cav_frame.height * jsonObj.y1;
							m_x2 = m_cav_frame.width * jsonObj.x2;
							m_y2 = m_cav_frame.height * jsonObj.y2;
							m_x3 = m_cav_frame.width * jsonObj.x3;
							m_y3 = m_cav_frame.height * jsonObj.y3;
							m_x4 = m_cav_frame.width * jsonObj.x4;
							m_y4 = m_cav_frame.height * jsonObj.y4;
						}
					}
						break;

					//设置残缺页面补全反馈
					case 58: {
						CZUR_ID_SetPageFill_Response(jsonObj);
					}
						break;

					//识别图片保存为文档反馈
					case 60: {
						CZUR_ID_OCR_Document_Response(jsonObj);
					}
						break;

					//识别证件反馈
					case 62: {
						CZUR_ID_OCR_Paperwork_Response(jsonObj);
					}
						break;

					//开启人脸对比反馈
					case 64: {
						CZUR_ID_Start_Face_Match_Response(jsonObj);
					}
						break;

					case 144:
						{
							CZUR_ID_Start_Face_Live_Response(jsonObj);
						}
						break;

					//停止人脸对比反馈
					case 66: {
						CZUR_ID_Stop_Face_Match_Response(jsonObj);
					}
						break;

					//检测到的人脸区域反馈消息，此时用户可自行绘制人脸矩形区域
					case 67: {
						s_x1 = s_cav_frame.width * jsonObj.x1;
						s_y1 = s_cav_frame.height * jsonObj.y1;
						s_x2 = s_cav_frame.width * jsonObj.x2;
						s_y2 = s_cav_frame.height * jsonObj.y2;
						s_x3 = s_cav_frame.width * jsonObj.x3;
						s_y3 = s_cav_frame.height * jsonObj.y3;
						s_x4 = s_cav_frame.width * jsonObj.x4;
						s_y4 = s_cav_frame.height * jsonObj.y4;
						DrawMLine();
					}
						break;

					//拍照(BASE64编码数据)反馈
					case 69: {
						CZUR_ID_GrabBase64_Response(jsonObj);
					}
						break;

					//图像识别，返回文本结果反馈
					case 71: {
						CZUR_ID_OCR_Text_Response(jsonObj);
					}
						break;

					//查询匹配机型反馈
					case 73: {
						CZUR_ID_QueryMatchModel_Response(jsonObj);
					}
						break;

					//设置扫描幅面反馈
					case 75: {
						CZUR_ID_SetScanWide_Response(jsonObj);
					}
						break;

					//打开签名板反馈
					case 79: {
						CZUR_ID_SP_OpenDevice_Response(jsonObj);
					}
						break;

					//关闭签名板设备反馈
					case 81: {
						CZUR_ID_SP_CloseDevice_Response(jsonObj);
					}
						break;

					//清空签名内容反馈
					case 83: {
						CZUR_ID_SP_Clear_Response(jsonObj);
					}
						break;

					//打开指纹设备反馈
					case 91: {
						CZUR_ID_FP_OpenDevice_Response(jsonObj);
					}
						break;

					//关闭指纹设备反馈
					case 93: {
						CZUR_ID_FP_CloseDevice_Response(jsonObj);
					}
						break;

					//开启指纹特征数据采集反馈
					case 95:
					case 97: {
						CZUR_ID_FP_StartFeature_Response(jsonObj);
					}
						break;

					//停止指纹特征数据采集反馈
					case 99: {
						CZUR_ID_FP_StopFeature_Response(jsonObj);
					}
						break;

					//保存签名图像反馈
					case 85: {
						CZUR_ID_SP_SaveImageFile_Response(jsonObj);
					}
						break;

					//获取签名图像数据(BASE64)反馈
					case 87: {
						CZUR_ID_SP_GetJpgBase64_Response(jsonObj);
					}
						break;

					//开启条码识别反馈
					case 103: {
						CZUR_ID_BCR_Start_Response(jsonObj);
					}
						break;

					//停止条码识别反馈
					case 105: {
						CZUR_ID_BCR_Stop_Response(jsonObj);
					}
						break;

					//查询设备ID反馈
					case 107: {
						CZUR_ID_QueryDeviceID_Response(jsonObj);
					}
						break;

					//设置修复残留黑边反馈
					case 109: {
						CZUR_ID_SetEdgeRepair_Response(jsonObj);
					}
						break;

					//设置拍摄A4幅面反馈
					case 111: {
						CZUR_ID_SetA4Wide_Response(jsonObj);
					}
						break;

					//识别图片保存为文档反馈(扩展接口)
					case 113: {
						CZUR_ID_OCR_DocumentEx_Response(jsonObj);
					}
						break;

					//设置主摄像头亮度反馈
					case 121: {
						CZUR_ID_SetBrightness_Response(jsonObj);
					}
						break;

					//设置主摄像头对比度反馈
					case 123: {
						CZUR_ID_SetContrast_Response(jsonObj);
					}
						break;

					//限定JPG图像大小反馈
					case 128: {
						CZUR_ID_SetJpgMaxSize_Response(jsonObj);
					}
						break;

					//获取SDK版本反馈
					case 130: {
						CZUR_ID_GetVersion_Reponse(jsonObj);
					}
						break;

					//开启录像反馈
					case 132: {
						CZUR_ID_StartRecord_Response(jsonObj);
					}
						break;

					//停止录像反馈
					case 134: {
						CZUR_ID_StopRecord_Response(jsonObj);
					}
						break;

					//白色背景转透明背景反馈
					case 140: {
						CZUR_ID_WhiteCvTransparent_Response(jsonObj);
					}
						break;

					//设置拍照保存图像白背景转透明反馈
					case 142: {
						CZUR_ID_SetWhiteTransparent_Response(jsonObj);
					}
						break;
					case 158: {
						CZUR_ID_OCR_TextEx_Response(jsonObj);
					}
						break;

					//图像处理结果通知
					case 301: {
						CZUR_ID_IMAGE(jsonObj);
					}
						break;

					//录像状态结果通知
					case 303: {
						CZUR_ID_RECORD(jsonObj);
					}
						break;

					//HTTP上传结果通知
					case 305: {
						CZUR_ID_HTTP(jsonObj);
					}
						break;

					//OCR结果通知
					case 307: {
						CZUR_ID_OCR(jsonObj);
					}
						break;

					//多目标裁剪结果通知
					case 309: {
						CZUR_ID_MULTIOBJ(jsonObj);
					}
						break;

					//身份证读取结果通知
					case 311: {
						CZUR_ID_CVR(jsonObj);
					}
						break;

					//社保卡读取结果通知
					case 313: {
						CZUR_ID_SSC(jsonObj);
					}
						break;

					//密码键盘输入结果通知
					case 315: {
						CZUR_ID_PK(jsonObj);
					}
						break;

					//人脸对比结果通知
					case 317: {
						CZUR_ID_CFM(jsonObj);
					}
						break;

					//拍照(BASE64编码数据)结果通知
					case 318: {
						CZUR_ID_BASE64(jsonObj);
					}
						break;

					//签名板签名状态通知
					case 320: {
						CZUR_ID_SP_STATUS(jsonObj);
					}
						break;

					//指纹采集次数通知
					case 322: {
						CZUR_ID_FP_FREQUENCY(jsonObj);
					}
						break;

					//指纹特征数据通知
					case 324: {
						CZUR_ID_FP_FEATURE(jsonObj);

						//接收到指纹特征数据消息后，发送[停止采集指纹特征数据]指令，以便后续可以继续采集指纹特征数据
						var cmd = '{\"id\": 98}';
						ws_cmd.send(cmd);
					}
						break;

					//条码识别结果通知
					case 326: {
						CZUR_ID_BCR(jsonObj);
					}
						break;

					//设备移除状态通知
					case 328: {
						CZUR_ID_DEVICE_REMOVE(jsonObj);
					}
						break;
					//基于加密机读社保卡基本信息
					case 148: {
						CZUR_ID_GetSSCOption1_Response(jsonObj);
					}
						break;
					case 150: {
						CZUR_ID_GetSSCOption2_Response(jsonObj);
					}
						break;
					case 152: {
						CZUR_ID_GetSSCOption3_Response(jsonObj);
					}
						break;
					case 154: {
						CZUR_ID_SelectFolder_Response(jsonObj);
					}
						break;
					case 156: {
						CZUR_ID_SelectFile_Response(jsonObj);
					}
						break;
					case 330: {
						CZUR_ID_SelectResult_Response(jsonObj);
					}
						break;
					case 146: {
						CZUR_ID_Stop_Face_Live_Response(jsonObj);
					}
						break;
					case 164: {
						CZUR_ID_SP_Evaluate_Response(jsonObj);
					}
						break;
					case 334: {
						CZUR_EVENT_EVA_Status_Reply(jsonObj);
					}
						break;
					case 166: {
						CZUR_ID_Checkfile_Reply(jsonObj);
					}
						break;
					case 168: {
						CZUR_ID_CheckFolder_Reply(jsonObj);
					}
						break;
					case 170: {
						CZUR_ID_GetFilesUnderFolder_Reply(jsonObj);
					}
						break;
				}
			}
		}

		function CZUR_ID_CheckFile() {
			var file = document.getElementById("Checkfile");

			var jsonMsg = {
				id: 165,
				file: file.value,
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_Checkfile_Reply(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "本地文件存在\r\n" + txtlog.value;
				}
					break;
				case 8: {
					txtlog.value = "Plugion环境未初始化\r\n" + txtlog.value;
				}
					break;
				case 2: {
					txtlog.value = "传递参数为空\r\n" + txtlog.value;
				}
					break;
				case 33: {
					txtlog.value = "本地文件不存在\r\n" + txtlog.value;
				}
					break;
				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				}
					break;
			}
		}

		function CZUR_ID_CheckFolder() {
			var folder = document.getElementById("CheckFolder");

			var jsonMsg = {
				id: 167,
				folder: folder.value,
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_GetFilesUnderFolder() {
			var type = document.getElementById("GetFilesUnderFolderType");
			var folder = document.getElementById("GetFilesUnderFolder");

			var jsonMsg = {
				id: 169,
				folder: folder.value,
				type: type.value,
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_GetFilesUnderFolder_Reply(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					var image = jsonObj.files;
					txtlog.value = "获取文件成功，文件个数" + image.length + "\r\n" + txtlog.value;
					for (var i = 0; i < image.length; i++) {
						txtlog.value = image[i] + "\r\n" + txtlog.value;
					}
				}
					break;
				case 8: {
					txtlog.value = "Plugion环境未初始化\r\n" + txtlog.value;
				}
					break;
				case 10: {
					txtlog.value = "不支持的格式\r\n" + txtlog.value;
				}
					break;
				case 29: {
					txtlog.value = "没有找到指定格式的图像\r\n" + txtlog.value;
				}
					break;
				case 1: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				}
					break;
				case 2: {
					txtlog.value = "传递参数为空\r\n" + txtlog.value;
				}
					break;
				case 3: {
					txtlog.value = "系统资源不足\r\n" + txtlog.value;
				}
					break;
				case 33: {
					txtlog.value = "本地文件夹不存在\r\n" + txtlog.value;
				}
					break;
				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				}
					break;
			}
		}

		function CZUR_ID_CheckFolder_Reply(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "本地文件夹存在\r\n" + txtlog.value;
				}
					break;
				case 8: {
					txtlog.value = "Plugion环境未初始化\r\n" + txtlog.value;
				}
					break;
				case 2: {
					txtlog.value = "传递参数为空\r\n" + txtlog.value;
				}
					break;
				case 33: {
					txtlog.value = "本地文件夹不存在\r\n" + txtlog.value;
				}
					break;
				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				}
					break;
			}
		}

		function CZUR_ID_GetFileBase64() {
			var file = document.getElementById("getfile");

			var jsonMsg = {
				id: 118,
				file: file.value,
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_GetFileBase64_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "获取文件base64成功\r\n" + txtlog.value;

					j_img_base64.crossOrigin = 'anonymous';
					j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.base64;

					j_img_base64.onload = function (e) {
						j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
					}
				}
					break;
				case 8: {
					txtlog.value = "文件名无效\r\n" + txtlog.value;
				}
					break;
				case 2: {
					txtlog.value = "CZURPlugin未初始化\r\n" + txtlog.value;
				}
					break;
				case 33: {
					txtlog.value = "加载文件失败\r\n" + txtlog.value;
				}
					break;
				case 34: {
					txtlog.value = "获取文件大小失败\r\n" + txtlog.value;
				}
					break;
				case 79: {
					txtlog.value = "文件储存过大，暂不支持\r\n" + txtlog.value;
				}
					break;
				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				}
					break;
				default: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				}
					break;
			}
		}

		function CZUR_ID_Stop_Face_Live_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "停止活体检测成功\r\n" + txtlog.value;
				}
					break;
				case 2: {
					txtlog.value = "CZURPlugin未初始化\r\n" + txtlog.value;
				}
					break;
			}
		}

		//将身份证读取结果通知给调用者
		function CZUR_ID_CVR(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					if (0 == jsonObj.type) {
						//jsonObj.header为身份证的头像的JPG(BASE64编码)图像数据，demo中不做显示处理，用户自行决定处理
						txtlog.value = "有效期限: " + jsonObj.startdate + " - " + jsonObj.enddate + "\r\n" + txtlog.value;
						txtlog.value = "签发机关: " + jsonObj.agency + "\r\n" + txtlog.value;
						txtlog.value = "公民身份号码: " + jsonObj.cardno + "\r\n" + txtlog.value;
						txtlog.value = "住址: " + jsonObj.address + "\r\n" + txtlog.value;
						txtlog.value = "出生日期: " + jsonObj.birthday + "\r\n" + txtlog.value;
						txtlog.value = "民族: " + jsonObj.nation + "\r\n" + txtlog.value;
						txtlog.value = "性别: " + jsonObj.sex + "\r\n" + txtlog.value;
						txtlog.value = "姓名: " + jsonObj.name + "\r\n" + txtlog.value;

						if (jsonObj.fp1Pos) {
							switch (jsonObj.fp1Pos) {
								case 0: {
									txtlog.value = "第一枚指纹：无\r\n" + txtlog.value;
								} break;

								case 1: {
									txtlog.value = "第一枚指纹：左手拇指\r\n" + txtlog.value;
								} break;

								case 2: {
									txtlog.value = "第一枚指纹：左手食指\r\n" + txtlog.value;
								} break;

								case 3: {
									txtlog.value = "第一枚指纹：左手中指\r\n" + txtlog.value;
								} break;

								case 4: {
									txtlog.value = "第一枚指纹：左手无名指\r\n" + txtlog.value;
								} break;

								case 5: {
									txtlog.value = "第一枚指纹：左手小指\r\n" + txtlog.value;
								} break;

								case 6: {
									txtlog.value = "第一枚指纹：右手拇指\r\n" + txtlog.value;
								} break;

								case 7: {
									txtlog.value = "第一枚指纹：右手食指\r\n" + txtlog.value;
								} break;

								case 8: {
									txtlog.value = "第一枚指纹：右手中指\r\n" + txtlog.value;
								} break;

								case 9: {
									txtlog.value = "第一枚指纹：右手无名指\r\n" + txtlog.value;
								} break;

								case 10: {
									txtlog.value = "第一枚指纹：右手小指\r\n" + txtlog.value;
								} break;
							}
						}

						if (jsonObj.fp1) {
							txtlog.value = "第一枚指纹数据: " + jsonObj.fp1 + "\r\n" + txtlog.value;
						}
						else {
							txtlog.value = "第一枚指纹未登记" + "\r\n" + txtlog.value;
						}

						if (jsonObj.fp2Pos) {
							switch (jsonObj.fp2Pos) {
								case 0: {
									txtlog.value = "第二枚指纹：无\r\n" + txtlog.value;
								} break;

								case 1: {
									txtlog.value = "第二枚指纹：左手拇指\r\n" + txtlog.value;
								} break;

								case 2: {
									txtlog.value = "第二枚指纹：左手食指\r\n" + txtlog.value;
								} break;

								case 3: {
									txtlog.value = "第二枚指纹：左手中指\r\n" + txtlog.value;
								} break;

								case 4: {
									txtlog.value = "第二枚指纹：左手无名指\r\n" + txtlog.value;
								} break;

								case 5: {
									txtlog.value = "第二枚指纹：左手小指\r\n" + txtlog.value;
								} break;

								case 6: {
									txtlog.value = "第二枚指纹：右手拇指\r\n" + txtlog.value;
								} break;

								case 7: {
									txtlog.value = "第二枚指纹：右手食指\r\n" + txtlog.value;
								} break;

								case 8: {
									txtlog.value = "第二枚指纹：右手中指\r\n" + txtlog.value;
								} break;

								case 9: {
									txtlog.value = "第二枚指纹：右手无名指\r\n" + txtlog.value;
								} break;

								case 10: {
									txtlog.value = "第二枚指纹：右手小指\r\n" + txtlog.value;
								} break;
							}
						}
						if (jsonObj.fp2) {
							txtlog.value = "第二枚指纹数据: " + jsonObj.fp2 + "\r\n" + txtlog.value;
						}
						else {
							txtlog.value = "第二枚指纹未登记" + "\r\n" + txtlog.value;
						}

						head_base64 = jsonObj.header;

						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.header;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}

						j_img_base642.crossOrigin = 'anonymous';
						j_img_base642.src = 'data:image/jpeg;base64,' + jsonObj.compose;

						j_img_base642.onload = function (e) {
							j_ctx_base642.drawImage(j_img_base642, 0, 0, j_cav_base642.width, j_cav_base642.height);
						}

						txtlog.value = "成功读取到身份证信息: \r\n" + txtlog.value;
					} else {
						if (1 == jsonObj.type) {
							txtlog.value = "合成正反面成功，文件名称: " + jsonObj.image + "\r\n" + txtlog.value;
						}
					}
				} break;

				case 1: {
					txtlog.value = "读取身份证信息发生异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存图像文件失败\r\n" + txtlog.value;
				} break;

				case 45: {
					txtlog.value = "打开读卡器失败\r\n" + txtlog.value;
				} break;

				case 46: {
					txtlog.value = "未检测到身份证，请放置身份证，再次尝试\r\n" + txtlog.value;
				} break;

				case 47: {
					txtlog.value = "读取身份证信息失败\r\n" + txtlog.value;
				} break;
			}
		}

		//将社保卡读取结果通知给调用者
		function CZUR_ID_SSC(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "出生日志: " + jsonObj.Birthday + "\r\n" + txtlog.value;
					txtlog.value = "民族: " + jsonObj.Nation + "\r\n" + txtlog.value;
					txtlog.value = "性别: " + jsonObj.Sex + "\r\n" + txtlog.value;
					txtlog.value = "姓名: " + jsonObj.Name + "\r\n" + txtlog.value;
					txtlog.value = "社会保障号码: " + jsonObj.SSN + "\r\n" + txtlog.value;
					txtlog.value = "卡有效期: " + jsonObj.Term + "\r\n" + txtlog.value;
					txtlog.value = "发卡日期: " + jsonObj.Date + "\r\n" + txtlog.value;
					txtlog.value = "卡号: " + jsonObj.NO + "\r\n" + txtlog.value;
					txtlog.value = "机构编号: " + jsonObj.SN + "\r\n" + txtlog.value;
					txtlog.value = "规范版本: " + jsonObj.Ver + "\r\n" + txtlog.value;
					switch (jsonObj.Type) {
						case 1: {
							txtlog.value = "卡类型: 学龄前儿童卡\r\n" + txtlog.value;
						} break;

						case 2: {
							txtlog.value = "卡类型: 学生卡\r\n" + txtlog.value;
						} break;

						case 3: {
							txtlog.value = "卡类型: 成年人卡\r\n" + txtlog.value;
						} break;

						case 4: {
							txtlog.value = "卡类型: 老年人卡\r\n" + txtlog.value;
						} break;
					}
					txtlog.value = "识别码: " + jsonObj.IC + "\r\n" + txtlog.value;

					txtlog.value = "成功读取到社保卡信息: \r\n" + txtlog.value;
				}
					break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 45: {
					txtlog.value = "打开读卡器失败\r\n" + txtlog.value;
				} break;

				case 46: {
					txtlog.value = "未检测到社保卡，请放置社保卡，再次尝试\r\n" + txtlog.value;
				} break;

				case 47: {
					txtlog.value = "读取社保卡信息失败\r\n" + txtlog.value;
				} break;
				case 52: {
					txtlog.value = "无PSAM卡\r\n" + txtlog.value;
				} break;
			}
		}

		//将多目标裁剪结果通知给调用者
		function CZUR_ID_MULTIOBJ(jsonObj) {
			var count = jsonObj.count;
			if (count > 0) {
				for (var i = 1; i <= count; i++) {
					var idx = jsonObj.number + i - 1;
					message = "第 " + i + "目标图像: " + jsonObj.path + "\\" + jsonObj.prefix + idx + ".jpg\r\n";
					txtlog.value = message + txtlog.value;
				}

				txtlog.value = "图像文件: " + jsonObj.image + "裁剪为 " + count + "个目标图片\r\n" + txtlog.value;
			}
			else {
				txtlog.value = "图像文件：" + jsonObj.image + " 多目标裁剪失败\r\n" + txtlog.value;
			}
		}

		//将OCR结果通知给调用者
		function CZUR_ID_OCR(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					//type代表识别类型，0(驾驶证)、1(行驶证)、2(护照)、3(港澳通行证)、4(文档识别)
					switch (jsonObj.type) {
						case 0: {
							txtlog.value = "识别驾驶证成功，识别结果: \r\n" + JSON.stringify(jsonObj.result) + "\r\n" + txtlog.value;
						} break;

						case 1: {
							txtlog.value = "识别行驶证成功，识别结果: \r\n" + JSON.stringify(jsonObj.result) + "\r\n" + txtlog.value;
						} break;

						case 2: {
							txtlog.value = "识别护照成功，识别结果: \r\n" + JSON.stringify(jsonObj.result) + "\r\n" + txtlog.value;
						} break;

						case 3: {
							txtlog.value = "识别港澳通行证证成功，识别结果: \r\n" + JSON.stringify(jsonObj.result) + "\r\n" + txtlog.value;
						} break;

						case 4: {
							txtlog.value = "识别文档成功，文档保存名称: \r\n" + jsonObj.result + "\r\n" + txtlog.value;
						} break;

						case 5: {
							txtlog.value = "识别成功，文本内容：\r\n" + jsonObj.result + "\r\n" + txtlog.value;
						} break;
					}
				}
					break;

				case 1: {
					txtlog.value = "异常错误，导致OCR失败\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，导致识别失败\r\n" + txtlog.value;
				} break;

				case 29: {
					txtlog.value = "未加载任何图像文件\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "识别的图像文件不存在\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存识别结果失败，请检查保存路径是否有效\r\n" + txtlog.value;
				} break;

				case 51: {
					txtlog.value = "当前用户权限不够，导致OCR失败\r\n" + txtlog.value;
				} break;

				case 76: {
					txtlog.value = "未安装CZUR Scanner客户端程序\r\n" + txtlog.value;
				} break;

				case 77: {
					txtlog.value = "无效的识别语言，仅支持中文简体、英文、中文繁体\r\n" + txtlog.value;
				} break;
			}
		}

		//将密码键入结果通知给调用者
		function CZUR_ID_PK(jsonObj) {
			var error = jsonObj.error;
			if (48 == error) {
				txtlog.value = "用户已取消密码输入\r\n" + txtlog.value;
			}
			else {
				txtlog.value = "键入的密码内容: " + jsonObj.key + "\r\n" + txtlog.value;
			}
			//关闭密码键盘
			CZUR_ID_PK_CloseDevice();
		}

		//将人脸识别对比结果通知给调用者
		function CZUR_ID_CFM(jsonObj) {
			var error = jsonObj.error;

			var type = jsonObj.type;

			if (type == 1) {
				switch (error) {
					case 0: {
						s_process_type = 0;
						txtlog.value = "人脸对比成功\r\n" + txtlog.value;

						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.base64;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}

					} break;

					case 1: {
						txtlog.value = "发生异常错误，导致人脸对比失败\r\n" + txtlog.value;
					} break;

					case 60: {
						txtlog.value = "授权过期，无法进行人脸对比\r\n" + txtlog.value;
					} break;

					case 61: {
						txtlog.value = "未检测到提供图片中的人脸\r\n" + txtlog.value;
					} break;

					case 62: {
						txtlog.value = "提取提供图片中的脸部特征失败\r\n" + txtlog.value;
					} break;

					case 84: {
						txtlog.value = "人脸比对超时\r\n" + txtlog.value;
					} break;
				}
			}
			else {
				switch (error) {
					case 0: {
						txtlog.value = "活体检测成功\r\n" + txtlog.value;
					} break;

					case 1: {
						txtlog.value = "发生异常错误，导致活体检测失败\r\n" + txtlog.value;
					} break;

					case 60: {
						txtlog.value = "授权过期，无法进行活体检测\r\n" + txtlog.value;
					} break;

					case 61: {
						txtlog.value = "未检测到人脸\r\n" + txtlog.value;
					} break;
					case 83: {
						txtlog.value = "活体检测失败\r\n" + txtlog.value;
					} break;
					case 84: {
						txtlog.value = "活体检测超时\r\n" + txtlog.value;
					} break;
				}
			}


		}

		//将指纹采集次数通知给调用者
		function CZUR_ID_FP_FREQUENCY(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "采集成功\r\n" + txtlog.value;
					//若jsonObj.base64字段不为null,则说明当前获取指纹图像的JPG(BASE64编码)数据，直接进行显示
					if (jsonObj.base64 != "null") {
						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.base64;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}
					}
				}
					break;

				case 1: {
					txtlog.value = "采集指纹发生异常，请再次按压指纹\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存指纹图像失败\r\n" + txtlog.value;
				} break;
			}
		}

		//将指纹特征数据通知给调用者
		function CZUR_ID_FP_FEATURE(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					//jsonObj.feature字段为指纹特征数据
					txtlog.value = "指纹特征数据采集成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误, 采集指纹特征数据失败\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，导致指纹特征数据采集失败\r\n" + txtlog.value;
				} break;
			}
		}

		//将条码/二维码识别结果通知给调用者
		function CZUR_ID_BCR(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					switch (jsonObj.type) {
						case 8: {
							txtlog.value = "识别到条码，类型: EAN-8，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 9: {
							txtlog.value = "识别到条码，类型: UPC-E，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 12: {
							txtlog.value = "识别到条码，类型: UPC-A，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 13: {
							txtlog.value = "识别到条码，类型: EAN-13，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 14: {
							txtlog.value = "识别到条码，类型: ISBN-13，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 25: {
							txtlog.value = "识别到条码，类型: Interleaved 2 of 5，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 39: {
							txtlog.value = "识别到条码，类型: Code 39，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 64: {
							txtlog.value = "识别到条码，类型: QR Code, 内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;

						case 128: {
							txtlog.value = "识别到条码，类型: Code 128，内容: " + jsonObj.text + "\r\n" + txtlog.value;
						} break;
					}
				} break;

				case 1: {
					txtlog.value = "异常错误, 条码识别失败\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，导致条码识别失败\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转码失败\r\n" + txtlog.value;
				} break;

				case 59: {
					txtlog.value = "无效的JPG图像数据，无法识别条码\r\n" + txtlog.value;
				} break;

				case 72: {
					txtlog.value = "未识别到任何条码内容\r\n" + txtlog.value;
				} break;
			}
		}

		//将设备移除状态通知给调用者
		function CZUR_ID_DEVICE_REMOVE(jsonObj) {
			var index = jsonObj.index;
			switch (index) {
				case 0: {
					txtlog.value = "主摄像头已移除\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "副摄像头已移除\r\n" + txtlog.value;
				} break;
			}
		}

		//将用户当前签名状态通知给调用者
		function CZUR_ID_SP_STATUS(jsonObj) {
			var status = jsonObj.status;

			switch (status) {
				case 0: {
					txtlog.value = "用户已确认签名\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "用户已清空签名\r\n" + txtlog.value;
				} break;

				case 2: {
					txtlog.value = "用户已取消签名\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "签批服务发生异常\r\n" + txtlog.value;
				} break;
			}
		}

		//将HTTP上传结果信息通知给调用者
		function CZUR_ID_HTTP(jsonObj) {
			if (0 == jsonObj.error) {
				txtlog.value = "HTTP上传成功，描述信息: " + "\r\n" + jsonObj.message + "\r\n" + txtlog.value;
			} else {
				txtlog.value = "HTTP上传失败，错误码：" + jsonObj.error + " 描述信息：" + jsonObj.message + "\r\n" + txtlog.value;
			}
		}

		//将处理完毕的JPG(BASE64编码)图像数据信息通知给调用者
		function CZUR_ID_BASE64(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					//图像处理成功，判断是否识别到条码
					switch (jsonObj.type) {
						case 8: {
							txtlog.value = "识别到条码，类型: EAN-8，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 9: {
							txtlog.value = "识别到条码，类型: UPC-E，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 12: {
							txtlog.value = "识别到条码，类型: UPC-A，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 13: {
							txtlog.value = "识别到条码，类型: EAN-13，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 14: {
							txtlog.value = "识别到条码，类型: ISBN-13，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 25: {
							txtlog.value = "识别到条码，类型: Interleaved 2 of 5，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 39: {
							txtlog.value = "识别到条码，类型: Code 39，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 64: {
							txtlog.value = "识别到条码，类型: QR Code, 内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 128: {
							txtlog.value = "识别到条码，类型: Code 128，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;
					}

					txtlog.value = "获取BASE64图像数据成功\r\n" + txtlog.value;

					//demo中只是简单的对BASE64数据进行显示
					if (jsonObj.b641 != "null") {

						//console.log(jsonObj.b641);

						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.b641;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}
					}

					if (jsonObj.b642 != "null") {
						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.b642;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}
					}
				}
					break;

				case 1: {
					txtlog.value = "发生异常错误，无法获取JPG图像数据\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 40: {
					txtlog.value = "图像为空白页，不保存BASE64编码数据\r\n" + txtlog.value;
				} break;
			}
		}

		//将处理完毕的图像信息通知给调用者
		function CZUR_ID_IMAGE(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					//图像处理成功，判断是否识别到条码
					switch (jsonObj.type) {
						case 8: {
							txtlog.value = "识别到条码，类型: EAN-8，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 9: {
							txtlog.value = "识别到条码，类型: UPC-E，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 12: {
							txtlog.value = "识别到条码，类型: UPC-A，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 13: {
							txtlog.value = "识别到条码，类型: EAN-13，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 14: {
							txtlog.value = "识别到条码，类型: ISBN-13，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 25: {
							txtlog.value = "识别到条码，类型: Interleaved 2 of 5，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 39: {
							txtlog.value = "识别到条码，类型: Code 39，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 64: {
							txtlog.value = "识别到条码，类型: QR Code, 内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;

						case 128: {
							txtlog.value = "识别到条码，类型: Code 128，内容: " + jsonObj.barcode + "\r\n" + txtlog.value;
						} break;
					}

					if (jsonObj.file1 != "null") {
						txtlog.value = "保存图像成功，文件名称为: " + jsonObj.file1 + "\r\n" + txtlog.value;

						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.b641;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}
					}

					if (jsonObj.file2 != "null") {
						txtlog.value = "保存图像成功，文件名称为: " + jsonObj.file2 + "\r\n" + txtlog.value;
					}
				} break;

				case 1: {
					txtlog.value = "发生异常错误，无法保存图像\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存图像文件失败，请检查路径是否有效\r\n" + txtlog.value;
				} break;

				case 37: {
					txtlog.value = "源PDF文档存在密码保存，导致保存图像失败\r\n" + txtlog.value;
				} break;

				case 40: {
					txtlog.value = "图像为空白页，不保存文件\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_RECORD(jsonObj) {
			var index = jsonObj.index;
			var sec = jsonObj.sec;
			var size = jsonObj.size;

			switch (index) {
				case 0:
					{
						txtlog.value = "主摄像头录像时间: " + sec + ", 录像大小: " + size + "\r\n" + txtlog.value;
					}
					break;
				case 1:
					{
						txtlog.value = "副摄像头录像时间: " + sec + ", 录像大小: " + size + "\r\n" + txtlog.value;
					}
					break;
				case 2:
					{
						txtlog.value = "红外摄像头录像时间: " + sec + ", 录像大小: " + size + "\r\n" + txtlog.value;
					}
					break;
			}
		}

		//获取SDK版本，格式：{"id": 129}
		function CZUR_ID_GetVersion() {
			var jsonMsg = {
				id: 129
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//获取SDK版本反馈，格式: {"id": 130, "error": 错误代码, "version": "版本信息"}
		function CZUR_ID_GetVersion_Reponse(jsonObj) {
			var error = jsonObj.error;
			if (0 == error) {
				document.getElementById("sdkver").value = jsonObj.version;
			}
			else {
				document.getElementById("sdkver").value = "获取版本号失败";
			}
		}

		//查询匹配机型，格式: {"id": 72, "license": "授权码"}
		function CZUR_ID_QueryMatchModel() {
			var license = document.getElementById("license");

			var jsonMsg = {
				id: 72,
				license: license.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//查询匹配机型反馈，格式: {"id": 73, "error": 错误代码, "model": "设备型号"}
		function CZUR_ID_QueryMatchModel_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					document.getElementById("matchmodel").value = jsonObj.model;
				} break;

				case 1: {
					document.getElementById("matchmodel").value = "发生异常错误，无法查询匹配机型";
				} break;

				case 3: {
					document.getElementById("matchmodel").value = "系统内存不足";
				} break;

				case 6: {
					document.getElementById("matchmodel").value = "无效的授权码";
				} break;

				case 13: {
					document.getElementById("matchmodel").value = "设备未连接，请将设备连接电脑";
				} break;

				case 43: {
					document.getElementById("matchmodel").value = "字符集转换失败";
				} break;
			}
		}

		//查询设备ID，格式: {"id": 106}
		function CZUR_ID_QueryDeviceID() {
			var jsonMsg = {
				id: 106
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//查询设备ID反馈，格式：{"id": 107, "error": 错误代码, "did": "设备 ID"}
		function CZUR_ID_QueryDeviceID_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					document.getElementById("deviceid").value = jsonObj.did;
				} break;

				case 1: {
					document.getElementById("deviceid").value = "发生异常，无法获取设备ID";
				} break;

				case 3: {
					document.getElementById("deviceid").value = "系统内存不足";
				} break;

				case 13: {
					document.getElementById("deviceid").value = "未连接设备";
				} break;

				case 43: {
					document.getElementById("deviceid").value = "字符集转换失败";
				} break;
			}
		}

		//初始化CZURPlugin环境，格式: {"id": 1, "license": "授权码"}
		function CZUR_ID_Initialize() {
			var license = document.getElementById("license");

			var jsonMsg = {
				id: 1,
				license: license.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//初始化CZURPlugin环境反馈，格式: {"id": 2, "error": 错误代码}
		function CZUR_ID_Initialize_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "初始化CZURPlugin成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 6: {
					txtlog.value = "无效的授权码\r\n" + txtlog.value;
				} break;

				case 9: {
					txtlog.value = "CZURPlugin环境已初始化\r\n" + txtlog.value;
				} break;

				case 42: {
					txtlog.value = "创建图像处理线程失败\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		//清除CZURPlugin环境，格式: {"id": 3}
		function CZUR_ID_Deintialize() {
			var jsonMsg = {
				id: 3
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//清除CZURPlugin环境反馈，格式: {"id": 4, "error": 错误代码}
		function CZUR_ID_Deintialize_Response(jsonObj) {
			txtlog.value = "清除CZURPlugin成功\r\n" + txtlog.value;
		}

		//读取身份证信息，格式：{"id": 44}
		function CZUR_ID_GetIDCardOption() {
			var jsonMsg = {
				id: 44
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//读取身份证信息反馈，格式：{"id": 45, "error": 错误代码}
		function CZUR_ID_GetIDCardOption_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在读取身份证信息，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "读取身份证异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个读卡操作尚未结束\r\n" + txtlog.value;
				} break;

				case 5: {
					txtlog.value = "读取数据异常\r\n" + txtlog.value;
				} break;
				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持读卡器功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 45: {
					txtlog.value = "打开读卡器失败\r\n" + txtlog.value;
				} break;

				case 47: {
					txtlog.value = "读取身份证信息失败\r\n" + txtlog.value;
				} break;
			}
		}

		//读取身份证信息并合成图像文件，格式：{"id": 46, "image": "图像文件名称", "paper": 纸张类型, "dir": 合成方向}
		function CZUR_ID_GetIDCardImage() {
			var image = document.getElementById("idimage");
			var paper = document.getElementById("idpaper").selectedIndex;
			var dir = document.getElementById("iddir").selectedIndex;

			var jsonMsg = {
				id: 46,
				image: image.value,
				paper: paper,
				dir: dir
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//读取身份证信息并合成图像文件反馈，格式：{"id": 47, "error": 错误代码}
		function CZUR_ID_GetIDCardImage_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在读取身份证信息，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "合成身份证正反面发生异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个读卡操作尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持读卡器功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "非法的图像保存格式，仅支持jpg、jpeg、png、bmp扩展名\r\n" + txtlog.value;
				} break;

				case 34: {
					txtlog.value = "无效纸张类型\r\n" + txtlog.value;
				} break;

				case 35: {
					txtlog.value = "无效的合成方向\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		//读取社保卡信息，格式：{"id": 48}
		function CZUR_ID_GetSSCOption() {
			var jsonMsg = {
				id: 48
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//读取社保卡信息反馈，格式：{"id": 49, "error": 错误代码}
		function CZUR_ID_GetSSCOption_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在读取社保卡信息，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "读取社保卡信息发生异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个读卡操作尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持读取社保卡功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;
			}
		}

		//读取社保卡信息，格式：{"id": 147}
		function CZUR_ID_GetSSCOption1() {
			var jsonMsg = {
				id: 147,
				type: 3
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//读取社保卡信息反馈，格式：{"id": 148, "error": 错误代码, "result":错误信息}
		function CZUR_ID_GetSSCOption1_Response(jsonObj) {
			var error = jsonObj.error;
			var output = jsonObj.result;

			txtlog.value = output + "\r\n" + txtlog.value;
			switch (error) {
				case 0: {
					txtlog.value = "读取社保卡信息成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "读取社保卡信息发生异常错误\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载社保动态库失败\r\n" + txtlog.value;
				} break;

				case 85: {
					txtlog.value = "请执行基于加密机读取社保卡\r\n" + txtlog.value;
				} break;
			}
		}

		//读取社保卡信息，格式：{"id": 149}
		function CZUR_ID_GetSSCOption2() {
			var jsonMsg = {
				id: 149,
				type: 3
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//读取社保卡信息反馈，格式：{"id": 150, "error": 错误代码, "result":错误信息}
		function CZUR_ID_GetSSCOption2_Response(jsonObj) {
			var error = jsonObj.error;
			var output = jsonObj.result;
			txtlog.value = output + "\r\n" + txtlog.value;

			switch (error) {
				case 0: {
					txtlog.value = "基于加密机读取社保卡信息步骤一成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "基于加密机读取社保卡信息步骤一发生异常错误\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载社保动态库失败\r\n" + txtlog.value;
				} break;
			}
		}

		//读取社保卡信息，格式：{"id": 151}
		function CZUR_ID_GetSSCOption3() {
			var jiamiji = document.getElementById("idjiamiji");

			var jsonMsg = {
				id: 151,
				key: jiamiji.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//读取社保卡信息反馈，格式：{"id": 152, "error": 错误代码, "result":错误信息}
		function CZUR_ID_GetSSCOption3_Response(jsonObj) {
			var error = jsonObj.error;
			var output = jsonObj.result;
			txtlog.value = output + "\r\n" + txtlog.value;

			switch (error) {
				case 0: {
					txtlog.value = "基于加密机读取社保卡信息步骤二成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "基于加密机读取社保卡信息步骤二发生异常错误\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载社保动态库失败\r\n" + txtlog.value;
				} break;
			}
		}

		//设置主头预览分辨率 格式：{"id": 26, "index": 0, "width": 宽度, "height": 高度}
		function CZUR_SetMCPreviewResolution() {
			var width, height;

			switch (document.getElementById("mcwh").selectedIndex) {
				case 0:
					{
						width = 3264;
						height = 2448;

						document.getElementById("mframe").width = 2048;
						document.getElementById("mframe").height = 1536;
					}
					break;
				case 1:
					{
						width = 2592;
						height = 1944;

						document.getElementById("mframe").width = 2048;
						document.getElementById("mframe").height = 1536;
					}
					break;
				case 2:
					{
						width = 2048;
						height = 1536;

						document.getElementById("mframe").width = 2048;
						document.getElementById("mframe").height = 1536;
					}
					break;
				case 3:
					{
						width = 1600;
						height = 1200;

						document.getElementById("mframe").width = 1600;
						document.getElementById("mframe").height = 1200;
					}
					break;
				case 4:
					{
						width = 1536;
						height = 1152;

						document.getElementById("mframe").width = 1536;
						document.getElementById("mframe").height = 1152;
					}
					break;
				case 5:
					{
						width = 1280;
						height = 960;

						document.getElementById("mframe").width = 1280;
						document.getElementById("mframe").height = 960;
					}
					break;
				case 6:
					{
						width = 800;
						height = 600;

						document.getElementById("mframe").width = 800;
						document.getElementById("mframe").height = 600;
					}
					break;
				case 7:
					{
						width = 640;
						height = 480;

						document.getElementById("mframe").width = 640;
						document.getElementById("mframe").height = 480;
					}
					break;
			}

			var jsonMsg = {
				id: 26,
				index: 0,
				width: width,
				height: height
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		//设置副头预览分辨率, 格式：{"id": 26, "index": 1, "width": 宽度, "height": 高度}
		function CZUR_SetSCPreviewResolution() {
			var width, height;

			switch (document.getElementById("scwh").selectedIndex) {
				case 0:
					{
						width = 1024;
						height = 576;

						document.getElementById("mframe").width = 1024;
						document.getElementById("mframe").height = 576;
					}
					break;
				case 1:
					{
						width = 960;
						height = 540;

						document.getElementById("mframe").width = 960;
						document.getElementById("mframe").height = 540;
					}
					break;
				case 2:
					{
						width = 854;
						height = 480;

						document.getElementById("mframe").width = 854;
						document.getElementById("mframe").height = 480;
					}
					break;
				case 3:
					{
						width = 640;
						height = 360;

						document.getElementById("mframe").width = 640;
						document.getElementById("mframe").height = 360;
					}
					break;
			}

			var jsonMsg = {
				id: 26,
				index: 1,
				width: width,
				height: height
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		//打开签名板设备，格式: {"id": 78}
		function CZUR_ID_SP_OpenDevice() {
			var spfile = document.getElementById("spfile");

			var jsonMsg = {
				id: 78,
				spfile: spfile.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//打开签名板设备反馈，格式: {"id": 79, "error": 错误代码}
		function CZUR_ID_SP_OpenDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "成功打开签名板，请签名...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法打开签名板\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法打开签名板\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "签字板已打开，请关闭后重新发起签字\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持签名板功能\r\n" + txtlog.value;
				} break;

				case 12: {
					txtlog.value = "签名板已打开，请签名...\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 15: {
					txtlog.value = "打开签名板设备失败\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "不支持的待确认文件格式\r\n" + txtlog.value;
				} break;
			}
		}

		//关闭签名板，格式：{"id": 80}
		function CZUR_ID_SP_CloseDevice() {
			var jsonMsg = {
				id: 80
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//关闭签名板反馈，格式：{"id": 81, "error": 错误代码}
		function CZUR_ID_SP_CloseDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "已关闭签名板设备\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "尚未打开签名板设备\r\n" + txtlog.value;
				} break;
			}
		}

		//清空签名数据，格式: {"id": 82}
		function CZUR_ID_SP_Clear() {
			var jsonMsg = {
				id: 82
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//清空签名数据反馈，格式: {"id": 83, "error": 错误代码}
		function CZUR_ID_SP_Clear_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "已清空签名内容\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法清空签名内容\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "尚未打开签名板设备\r\n" + txtlog.value;
				} break;
			}
		}

		//保存签名图像，格式: {"id": 84, "image": "签名图像名称"}
		function CZUR_ID_SP_SaveImageFile() {
			var image = document.getElementById("spimage");

			var jsonMsg = {
				id: 84,
				image: image.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//保存签名图像反馈，格式: {"id": 85, "error": 错误代码}
		function CZUR_ID_SP_SaveImageFile_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "保存签名图像成功\r\n" + txtlog.value;
					}
					break;
				case 1:
					{
						txtlog.value = "异常错误，无法保存签名图像\r\n" + txtlog.value;
					}
					break;
				case 7:
					{
						txtlog.value = "无效的图像保存路径，请确认路径是否存在\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 14:
					{
						txtlog.value = "尚未打开签名板设备\r\n" + txtlog.value;
					}
					break;
				case 18:
					{
						txtlog.value = "非法的图像保存格式，仅支持jpg、png、bmp格式\r\n" + txtlog.value;
					}
					break;
				case 43:
					{
						txtlog.value = "字符集转换失败，无法保存签名图像\r\n" + txtlog.value;
					}
					break;
				case 65:
					{
						txtlog.value = "无签名数据可以保存，请签名\r\n" + txtlog.value;
					}
					break;
			}
		}

		//获取签名图像数据(BASE64)，格式: {"id": 86}
		function CZUR_ID_SP_GetJpgBase64() {
			var jsonMsg = {
				id: 86
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//获取签名图像数据(BASE64)反馈，格式: {"id": 87, "error": 错误代码, "base64": "签名图像 JPG 数据(BASE64 编码)"}
		function CZUR_ID_SP_GetJpgBase64_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "获取签名图像数据成功\r\n" + txtlog.value;

						j_img_base64.crossOrigin = 'anonymous';
						j_img_base64.src = 'data:image/jpeg;base64,' + jsonObj.base64;

						j_img_base64.onload = function (e) {
							j_ctx_base64.drawImage(j_img_base64, 0, 0, j_cav_base64.width, j_cav_base64.height);
						}
					}
					break;
				case 1:
					{
						txtlog.value = "异常错误，无法获取签名图像数据\r\n" + txtlog.value;
					}
					break;
				case 3:
					{
						txtlog.value = "系统内存不足，无法获取签名图像数据\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 14:
					{
						txtlog.value = "尚未打开签名板设备\r\n" + txtlog.value;
					}
					break;
				case 65:
					{
						txtlog.value = "无签名数据可以保存，请签名\r\n" + txtlog.value;
					}
					break;
			}
		}

		//打开指纹设备，格式：{"id": 90}
		function CZUR_ID_FP_OpenDevice() {
			var jsonMsg = {
				id: 90
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//打开指纹设备反馈，格式：{"id": 91, "error": 错误代码}
		function CZUR_ID_FP_OpenDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "成功打开指纹设备\r\n" + txtlog.value;
					}
					break;
				case 1:
					{
						txtlog.value = "异常错误，无法打开指纹设备\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 10:
					{
						txtlog.value = "设备不支持指纹功能\r\n" + txtlog.value;
					}
					break;
				case 12:
					{
						txtlog.value = "指纹设备已开启\r\n" + txtlog.value;
					}
					break;
				case 13:
					{
						txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
					}
					break;
				case 15:
					{
						txtlog.value = "打开指纹设备失败\r\n" + txtlog.value;
					}
					break;
			}
		}

		//关闭指纹设备，格式: {"id": 92}
		function CZUR_ID_FP_CloseDevice() {
			var jsonMsg = {
				id: 92
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//关闭指纹设备反馈，格式: {"id": 93, "error": 错误代码}
		function CZUR_ID_FP_CloseDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "成功关闭指纹设备\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 14:
					{
						txtlog.value = "指纹设备尚未打开\r\n" + txtlog.value;
					}
					break;
			}
		}

		//开启指纹特征数据采集，格式：{"id": 94} 或 {"id": 96, "image": "图像文件名称"}
		function CZUR_ID_FP_StartFeature() {
			if (document.getElementsByName('FPsaveImage')[0].checked) {
				//不保存指纹图像
				var jsonMsg = {
					id: 94
				};
				ws_cmd.send(JSON.stringify(jsonMsg));
			}
			else if (document.getElementsByName('FPsaveImage')[1].checked) {
				//保存指纹图像文件
				var image = document.getElementById("fpimage");
				var jsonMsg = {
					id: 96,
					image: image.value
				};
				ws_cmd.send(JSON.stringify(jsonMsg));
			}
			else if (document.getElementsByName('FPsaveImage')[2].checked) {
				//保存指纹JPG(BASE64编码)图像数据
				var jsonMsg = {
					id: 96,
					image: ""
				};
				ws_cmd.send(JSON.stringify(jsonMsg));
			}
		}
		//开启指纹特征数据采集反馈，格式：{"id": 95, "error": 错误代码} 或 {"id": 97, "error": 错误代码}
		function CZUR_ID_FP_StartFeature_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "成功开启指纹特征数据采集，请按压手指\r\n" + txtlog.value;
					}
					break;
				case 1:
					{
						txtlog.value = "异常错误，无法开启指纹特征数据采集\r\n" + txtlog.value;
					}
					break;
				case 4:
					{
						txtlog.value = "已开启了指纹特征数据采集\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 14:
					{
						txtlog.value = "指纹设备尚未开启，无法采集特征数据\r\n" + txtlog.value;
					}
					break;
			}
		}

		//停止指纹特征数据采集，格式: {"id": 98}
		function CZUR_ID_FP_StopFeature() {
			var jsonMsg = {
				id: 98
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//停止指纹特征数据采集反馈，格式: {"id": 99, "error": 错误代码}
		function CZUR_ID_FP_StopFeature_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "已停止指纹特征数据采集\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 14:
					{
						txtlog.value = "指纹设备尚未开启\r\n" + txtlog.value;
					}
					break;
			}
		}

		//开启人脸对比，格式： {"id": 63, "type": JPEG 数据类型, "jpeg": "JPEG 数据", "threshold": 人脸对比阈值}
		function CZUR_ID_Start_Face_Match() {
			var jpeg = document.getElementById("faceimage");
			var timeout = parseInt(document.getElementById("facetimeout").value);

			//测试演示，对比阈值为80，用户可自行根据场景设置合理的对比阈值
			var jsonMsg = {
				id: 63,
				type: 1,
				jpeg: jpeg.value,
				threshold: 80,
				timeout: timeout
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_Start_Face_Match2() {
			var jpeg = document.getElementById("faceimage");
			var value = parseInt(document.getElementById("facetimeout").value);

			//测试演示，对比阈值为80，用户可自行根据场景设置合理的对比阈值
			var jsonMsg = {
				id: 63,
				type: 2,
				jpeg: head_base64,
				threshold: 80,
				timeout: value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		//开启人脸对比反馈，格式： {"id": 64, "error": 错误代码}
		function CZUR_ID_Start_Face_Match_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					is_draw_s_frame = true;
					s_process_type = 2;
					txtlog.value = "正在进行人脸对比...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行人脸对比\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行人脸对比\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个人脸识别任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持人脸对比功能\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "副摄像头未打开，请先打开副摄像头\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载JPG图像失败\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转码失败\r\n" + txtlog.value;
				} break;

				case 44: {
					txtlog.value = "获取JPG图像大小失败\r\n" + txtlog.value;
				} break;

				case 56: {
					txtlog.value = "无效的数据类型标记\r\n" + txtlog.value;
				} break;

				case 57: {
					txtlog.value = "无效的人脸对比阈值\r\n" + txtlog.value;
				} break;

				case 58: {
					txtlog.value = "解码JPG(BASE64编码)失败\r\n" + txtlog.value;
				} break;

				case 59: {
					txtlog.value = "无效的JPG图像数据格式\r\n" + txtlog.value;
				} break;
				case 61: {
					txtlog.value = "原图中未检测到人脸\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_Start_Face_Live() {
			var jpeg = document.getElementById("faceimage");
			var value = parseInt(document.getElementById("livetimeout").value);

			//测试演示，对比阈值为80，用户可自行根据场景设置合理的对比阈值
			var jsonMsg = {
				id: 143,
				threshold: 80,
				timeout: value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_Start_Face_Live_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行活体检测...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行活体检测\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行活体检测\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个活体检测任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持活体检测功能\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "副摄像头未打开，请先打开副摄像头\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载JPG图像失败\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转码失败\r\n" + txtlog.value;
				} break;

				case 44: {
					txtlog.value = "获取JPG图像大小失败\r\n" + txtlog.value;
				} break;

				case 56: {
					txtlog.value = "无效的数据类型标记\r\n" + txtlog.value;
				} break;

				case 57: {
					txtlog.value = "无效的人脸对比阈值\r\n" + txtlog.value;
				} break;

				case 58: {
					txtlog.value = "解码JPG(BASE64编码)失败\r\n" + txtlog.value;
				} break;

				case 59: {
					txtlog.value = "无效的JPG图像数据格式\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_Stop_Face_Live() {
			var jpeg = document.getElementById("faceimage");

			//测试演示，对比阈值为80，用户可自行根据场景设置合理的对比阈值
			var jsonMsg = {
				id: 145
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		//删除本地文件，格式： {"id": 40, "file": "文件名称"}
		function CZUR_ID_DeleteFile() {
			var jsonMsg = {
				id: 40,
				file: "d:\\1.jpg"
			};
			//调用指令服务器的websocket对象发送这个数据包
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//删除本地文件反馈，格式： {"id": 41, "error": 错误代码}
		function CZUR_ID_DeleteFile_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "删除本地文件\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "删除本地文件发生异常错误\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		//停止人脸对比，格式： {"id": 65}
		function CZUR_ID_Stop_Face_Match() {
			var jsonMsg = {
				id: 65
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//停止人脸对比反馈，格式： {"id": 66, "error": 错误代码}
		function CZUR_ID_Stop_Face_Match_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					s_process_type = 0;
					txtlog.value = "已成功停止人脸对比\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "尚未进行人脸对比，无需停止\r\n" + txtlog.value;
				} break;
			}
		}

		//获取设备型号，格式: {"id": 5}
		function CZUR_ID_GetDeviceModel() {
			var jsonMsg = {
				id: 5
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//获取设备型号反馈，格式: {"id": 6, "error": 错误代码, "model": "设备型号"}
		function CZUR_ID_GetDeviceModel_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					document.getElementById("devmodel").value = jsonObj.model;
				} break;

				case 1: {
					document.getElementById("devmodel").value = "获取设备型号发生异常错误";
				} break;

				case 3: {
					document.getElementById("devmodel").value = "系统内存不足";
				} break;

				case 8: {
					document.getElementById("devmodel").value = "CZURPlugin环境未初始化";
				} break;

				case 13: {
					document.getElementById("devmodel").value = "设备未连接，请将设备连接电脑";
				} break;

				case 43: {
					document.getElementById("devmodel").value = "字符集转换失败";
				} break;
			}
		}

		//获取设备ID，格式: {"id": 7}
		function CZUR_ID_GetDeviceID() {
			var jsonMsg = {
				id: 7
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//获取设备ID反馈，格式: {"id": 8, "error": 错误代码, "did": "设备 ID"}
		function CZUR_ID_GetDeviceID_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					document.getElementById("devid").value = jsonObj.did;
				} break;

				case 3: {
					document.getElementById("devid").value = "系统内存不足";
				} break;

				case 8: {
					document.getElementById("devid").value = "CZURPlugin环境未初始化";
				} break;

				case 10: {
					document.getElementById("devid").value = "设备不支持ID读取";
				} break;

				case 14: {
					document.getElementById("devid").value = "设备未开启，无法获取设备ID";
				} break;

				case 43: {
					document.getElementById("devid").value = "字符集转换失败";
				} break;
			}
		}

		//打开设备，格式：{"id": 9, "index": 摄像头序号}
		function CZUR_ID_OpenDevice() {
			//摄像头分辨率
			var width, height;

			//摄像头序号
			var index = document.getElementById("devtype").selectedIndex;
			var jsonMsg = {
				id: 9,
				index: index
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//打开设备反馈，格式：{"id": 10, "error": 错误代码}
		function CZUR_ID_OpenDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					var index = document.getElementById("devtype").selectedIndex;
					if (0 == index) {
						is_draw_m_frame = true;
					}
					else if (2 == index) {
						is_draw_ir_frame = true;
					}
					else {
						is_draw_s_frame = true;
					}
					txtlog.value = "打开摄像头成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持副摄像头\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 12: {
					txtlog.value = "摄像头已打开\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;
			}
		}

		//设置A4拍摄幅面，格式：{"id": 110, "on": 0/1}
		function CZUR_ID_SetA4Wide() {
			var on = 0;
			if (document.getElementById("a4wide").checked) {
				on = 1;
			}

			var jsonMsg = {
				id: 110,
				on: on
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置A4拍摄幅面反馈，格式：{"id": 111, "error": 错误代码}
		function CZUR_ID_SetA4Wide_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					txtlog.value = "设置拍摄幅面成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "正在录像或人脸识别，无法设置\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持，无法设置A4拍摄幅面\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未开启，无法设置\r\n" + txtlog.value;
				} break;
			}
		}

		//关闭设备，格式: {"id": 11, "index": 摄像头序号}
		function CZUR_ID_CloseDevice() {
			//摄像头序号
			var index = document.getElementById("devtype").selectedIndex;

			var jsonMsg = {
				id: 11,
				index: index
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//关闭设备反馈，格式: {"id": 12, "error": 错误代码}
		function CZUR_ID_CloseDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					var index = document.getElementById("devtype").selectedIndex;
					if (0 == index) {
						is_draw_m_frame = false;
						m_ctx_frame.fillStyle = "#000000";
						m_ctx_frame.beginPath();
						m_ctx_frame.fillRect(0, 0, m_cav_frame.width, m_cav_frame.height);
						m_ctx_frame.closePath();
					}
					else if (2 == index) {
						is_draw_ir_frame = false;
						ir_ctx_frame.fillStyle = "#000000";
						ir_ctx_frame.beginPath();
						ir_ctx_frame.fillRect(0, 0, ir_cav_frame.width, ir_cav_frame.height);
						ir_ctx_frame.closePath();
					}
					else {
						is_draw_s_frame = false;
						s_ctx_frame.fillStyle = "#000000";
						s_ctx_frame.beginPath();
						s_ctx_frame.fillRect(0, 0, s_cav_frame.width, s_cav_frame.height);
						s_ctx_frame.closePath();
					}
					txtlog.value = "关闭摄像头成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "正在进行录像，无法关闭设备\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头未打开\r\n" + txtlog.value;
				} break;
			}
		}

		//设置图像处理分辨率，格式: {"id": 15, "index": 摄像头序号, "width": 横向分辨率, "height": 纵向分辨率}
		function CZUR_ID_SetResolution() {
			var index = document.getElementById("devtype").selectedIndex;
			var width = parseInt(document.getElementById("procwidth").value);
			var height = parseInt(document.getElementById("procheight").value);

			var jsonMsg = {
				id: 15,
				index: index,
				width: width,
				height: height
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置图像处理分辨率反馈消息，格式：{"id": 16, "error": 错误代码}
		function CZUR_ID_SetResolution_Response(jsonObj) {
			switch (jsonObj.error) {
				case 0: {
					txtlog.value = "成功设置分辨率\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效摄像头序号\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未打开，请先打开\r\n" + txtlog.value;
				} break;

				case 16: {
					txtlog.value = "无效分辨率数值\r\n" + txtlog.value;
				} break;
			}
		}

		//设置主摄像头亮度，格式: {"id": 120, "value": 亮度数值}
		function CZUR_ID_SetBrightness() {
			var value = parseInt(document.getElementById("brightness").value);

			var jsonMsg = {
				id: 120,
				value: value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置主摄像头亮度反馈消息，格式：{"id": 121, "error": 错误代码}
		function CZUR_ID_SetBrightness_Response(jsonObj) {
			switch (jsonObj.error) {
				case 0: {
					txtlog.value = "成功设置亮度\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "发生异常错误，无法设置亮度\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未打开，请先打开\r\n" + txtlog.value;
				} break;

				case 80: {
					txtlog.value = "无效亮度数值\r\n" + txtlog.value;
				} break;
			}
		}

		//设置主摄像头对比度，格式: {"id": 122, "value": 亮度数值}
		function CZUR_ID_SetContrast() {
			var value = parseInt(document.getElementById("contrast").value);

			var jsonMsg = {
				id: 122,
				value: value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置主摄像头对比度反馈消息，格式：{"id": 123, "error": 错误代码}
		function CZUR_ID_SetContrast_Response(jsonObj) {
			switch (jsonObj.error) {
				case 0: {
					txtlog.value = "成功设置对比度\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "发生异常错误，无法设置对比度\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未打开，请先打开\r\n" + txtlog.value;
				} break;

				case 80: {
					txtlog.value = "无效对比度数值\r\n" + txtlog.value;
				} break;
			}
		}

		//设置扫描幅面，格式：{"id": 74, "wide": 1/2}
		function CZUR_ID_SetScanWide() {
			var wide;
			switch (document.getElementById("scanwide").selectedIndex) {
				case 0:
					{
						//A4幅面
						wide = 1;
					}
					break;
				case 1:
					{
						//A3幅面
						wide = 2;
					}
					break;
			}

			var jsonMsg = {
				id: 74,
				wide: wide
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置扫描幅面反馈，格式：{"id": 75, "error": 错误代码}
		function CZUR_ID_SetScanWide_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "成功设置扫描幅面\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "当前设置不支持扫描幅面设置\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未打开，请先打开\r\n" + txtlog.value;
				} break;

				case 64: {
					txtlog.value = "无效的扫描幅面参数\r\n" + txtlog.value;
				} break;
			}
		}

		//限定JPG图像大小，格式: {"id": 127, "index": 摄像头序号, "priority": 优先级别, "size": 限定大小}
		function CZUR_ID_SetJpgMaxSize() {
			//摄像头序号
			var index = document.getElementById("devtype").selectedIndex;
			if (0 != index) {
				index = 1;
			}

			var size = 1024 * parseInt(document.getElementById("limitsize").value);

			var jsonMsg = {
				id: 127,
				index: index,
				priority: 1,
				size: size
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//限定JPG图像大小反馈，格式: {"id": 128, "error": 错误代码}
		function CZUR_ID_SetJpgMaxSize_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "设置成功\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "尚未打开摄像头\r\n" + txtlog.value;
				} break;

				case 81: {
					txtlog.value = "无效优先级别\r\n" + txtlog.value;
				} break;
			}
		}

		//添加水印，格式：{"id": 32, "index": 摄像头序号, "type": 水印类型, "pos": 位置, "size": 文本大小, "angle": 旋转角度, "ts": 是否显示时间戳, "format": 时间戳格式, "text": "水印内容", "red": 红色分量, "green": 绿色分量, "blue": 蓝色分量, "alpha": 透明度}
		function CZUR_ID_WaterMark_Add() {
			//摄像头序号
			var index = document.getElementById("devtype").selectedIndex;
			if (0 != index) {
				index = 1;
			}

			//水印位置
			var pos = document.getElementById("wmpos").selectedIndex;
			//水印类型
			var type = document.getElementById("wmtype").selectedIndex;
			//水印大小(像素单位)
			var size = parseInt(document.getElementById("wmsize").value);
			//水印旋转角度
			var angle = parseInt(document.getElementById("wmangle").value);
			//水印内容
			var text = document.getElementById("wmtext");

			var wmts = 0, tsformat = 0;
			if (document.getElementById("wmts").checked) {
				wmts = 1;
				tsformat = document.getElementById("tsformat").selectedIndex;
			}

			//水印颜色，RGB + 透明度
			var red = parseInt(document.getElementById("wmred").value);
			var green = parseInt(document.getElementById("wmgreen").value);
			var blue = parseInt(document.getElementById("wmblue").value);
			var alpha = parseInt(document.getElementById("wmalpha").value);

			var jsonMsg = {
				id: 32,
				index: index,
				type: type,
				pos: pos,
				size: size,
				angle: angle,
				ts: wmts,
				format: tsformat,
				text: text.value,
				red: red,
				green: green,
				blue: blue,
				alpha: alpha
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//添加水印反馈，格式：{"id": 33, "error": 错误代码}
		function CZUR_ID_WaterMark_Add_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "添加水印成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "添加水印发生异常错误\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持水印功能\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 24: {
					txtlog.value = "无效的时间戳显示格式\r\n" + txtlog.value;
				} break;

				case 25: {
					txtlog.value = "无效的水印位置\r\n" + txtlog.value;
				} break;

				case 26: {
					txtlog.value = "无效的水印类型\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		//清除水印，格式：{"id": 34, "index": 摄像头序号, "type": 水印类型}
		function CZUR_ID_WaterMark_Clear() {
			//摄像头序号
			var index = document.getElementById("devtype").selectedIndex;
			if (0 != index) {
				index = 1;
			}

			//水印类型
			var type = document.getElementById("wmtype").selectedIndex;

			var jsonMsg = {
				id: 34,
				index: index,
				type: type
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//清除水印反馈，格式：{"id": 35, "error": 错误代码}
		function CZUR_ID_WaterMark_Clear_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "清除水印成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "清除水印发生异常错误\r\n" + txtlog.value;
				} break;

				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					} break;

				case 10: {
					txtlog.value = "设备不支持水印功能\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 26: {
					txtlog.value = "无效的水印类型\r\n" + txtlog.value;
				} break;
			}
		}

		//白色背景转透明背景，格式: {"id": 139, "src": "源JPG图像名称", "dst": "PNG图像名称"}
		function CZUR_ID_WhiteCvTransparent() {
			var srcJpg = document.getElementById("srcJpg");
			var dstPng = document.getElementById("dstPng");

			var jsonMsg = {
				id: 139,
				src: srcJpg.value,
				dst: dstPng.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//白色背景转透明背景反馈，格式：{"id": 140, "error": 错误代码}
		function CZUR_ID_WhiteCvTransparent_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "转换透明背景成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "转换发生异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "无效的JPG图像格式\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载JPG图像失败\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存PNG图像失败\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;

				case 44: {
					txtlog.value = "获取JPG图像大小失败\r\n" + txtlog.value;
				} break;
			}
		}

		//拍照保存文件，格式: {"id": 13, "index": 摄像头序号, "file": "图像文件名称", "dpi": DPI, "color": 颜色模式, "round": 圆角留白, "adjust": 方向转正, "bcr": 条码识别, "bpd": 空白页检测, "quality": JPG压缩质量, "compress": TIFF压缩方式}
		function CZUR_ID_GrabImage() {
			//摄像头序号
			var index = document.getElementById("grabdevtype").selectedIndex;

			//图像文件名称
			var filename = document.getElementById("grabimage");

			//DPI
			var dpi = parseInt(document.getElementById("grabdpi").value);

			//色彩模式
			var color = document.getElementById("grabcolor").selectedIndex;

			//圆角留白
			var round = 0;
			if (document.getElementById("grabround").checked) {
				round = 1;
			}

			//方向调整
			var adjust = 0;
			if (document.getElementById("grabadjust").checked) {
				adjust = 1;
			}

			//识别条码
			var bcr = 0;
			if (document.getElementById("grabbcr").checked) {
				bcr = 1;
			}

			//空白页检测
			var bpd = 0;
			if (document.getElementById("grabbpd").checked) {
				bpd = 1;
			}

			//JPG压缩质量
			var quality = parseInt(document.getElementById("jpgquality").value);

			//TIFF压缩方式
			var compress = 1;
			switch (document.getElementById("tiffcompress").selectedIndex) {
				case 0://无压缩
					{
						compress = 1;
					}
					break;
				case 1://G4压缩
					{
						compress = 4;
					}
					break;
				case 2://LZW压缩
					{
						compress = 5;
					}
					break;
				case 3://JPEG压缩
					{
						compress = 7;
					}
					break;
			}

			//副摄像头仅支持彩色、灰度\黑白以及 DPI、JPG 压缩质量、TIFF 压缩方式设置，
			//round、 adjust、 bcr、 bpd 参数必须设置为 0
			if (1 == index) {
				round = 0;
				adjust = 0;
				bcr = 0;
				bpd = 0;
			}

			var jsonMsg = {
				id: 13,
				index: index,
				file: filename.value,
				dpi: dpi,
				color: color,
				round: round,
				adjust: adjust,
				bcr: bcr,
				bpd: bpd,
				quality: quality,
				compress: compress
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//拍照保存文件反馈，格式: {"id": 14, "error": 错误代码}
		function CZUR_ID_GrabImage_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "拍照成功，图像正在处理，请稍后\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "录像期间，无法拍照\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持某些拍照属性参数设置\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头尚未打开\r\n" + txtlog.value;
				} break;

				case 17: {
					txtlog.value = "无效的颜色模式\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "图像保存格式不合法，仅支持JPG、BMP、PNG、PDF、TIFF\r\n" + txtlog.value;
				} break;

				case 19: {
					txtlog.value = "激光线闪过之后，才可以拍摄下一张\r\n" + txtlog.value;
				} break;

				case 20: {
					txtlog.value = "非法TIFF压缩方式\r\n" + txtlog.value;
				} break;

				case 21: {
					txtlog.value = "无效的JPG压缩质量\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;

				case 50: {
					txtlog.value = "图像数据尚未准备好，请稍后再试\r\n" + txtlog.value;
				} break;
			}
		}

		//拍照保存JPG图像数据(BASE64编码)，格式: {"id": 68, "index": 摄像头序号, "dpi": DPI, "color": 颜色模式, "round": 圆角留白, "adjust": 方向转正, "bcr": 条码识别, "bpd": 空白页检测, "quality": JPG压缩质量}
		function CZUR_ID_GrabBase64() {
			//摄像头序号
			var index = document.getElementById("grabdevtype").selectedIndex;
			if ((0 != index) && (2 != index)) {
				index = 1;
			}

			//DPI
			var dpi = parseInt(document.getElementById("grabdpi").value);

			//色彩模式
			var color = document.getElementById("grabcolor").selectedIndex;

			//圆角留白
			var round = 0;
			if (document.getElementById("grabround").checked) {
				round = 1;
			}

			//方向调整
			var adjust = 0;
			if (document.getElementById("grabadjust").checked) {
				adjust = 1;
			}

			//识别条码
			var bcr = 0;
			if (document.getElementById("grabbcr").checked) {
				bcr = 1;
			}

			//空白页检测
			var bpd = 0;
			if (document.getElementById("grabbpd").checked) {
				bpd = 1;
			}

			//JPG压缩质量
			var quality = parseInt(document.getElementById("jpgquality").value);

			//副摄像头仅支持彩色、灰度\黑白以及 DPI、JPG 压缩质量、TIFF 压缩方式设置，
			//round、 adjust、 bcr、 bpd 参数必须设置为 0
			if (1 == index) {
				round = 0;
				adjust = 0;
				bcr = 0;
				bpd = 0;
			}

			var jsonMsg = {
				id: 68,
				index: index,
				dpi: dpi,
				color: color,
				round: round,
				adjust: adjust,
				bcr: bcr,
				bpd: bpd,
				quality: quality,
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//拍照保存JPG图像数据(BASE64编码)反馈，格式: {"id": 69, "error": 错误代码}
		function CZUR_ID_GrabBase64_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "拍照成功，图像正在处理，请稍后\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "录像期间，无法拍照\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持某些拍照属性参数设置\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效的摄像头序号\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头尚未打开，无法进行拍照操作\r\n" + txtlog.value;
				} break;

				case 17: {
					txtlog.value = "无效的颜色模式\r\n" + txtlog.value;
				} break;

				case 19: {
					txtlog.value = "激光线闪过之后，才可以拍摄下一张\r\n" + txtlog.value;
				} break;

				case 21: {
					txtlog.value = "无效的JPG压缩质量\r\n" + txtlog.value;
				} break;

				case 50: {
					txtlog.value = "图像数据尚未准备好，请稍后再试\r\n" + txtlog.value;
				} break;
			}
		}

		function ChangeRecordResolution() {
			var obj = document.getElementById("recordResolution");
			if (2 == obj.selectedIndex) {
				document.getElementById("recordWidth").style.display = "inline";
				document.getElementById("recordHeight").style.display = "inline";
			}
			else {
				document.getElementById("recordWidth").style.display = "none";
				document.getElementById("recordHeight").style.display = "none";
			}
		}

		//开启录像，格式: {"id": 131, "index": 0/1, "width": 录像分辨率, "height": 录像分辨率, "file": "录像文件"}
		function CZUR_ID_StartRecord() {
			record_camera_index = document.getElementById("recordDevtype").selectedIndex;
			var file = document.getElementById("recordFile");
			var width, height;

			switch (document.getElementById("recordResolution").selectedIndex) {
				case 0: {
					width = 1920;
					height = 1080;
				} break;

				case 1: {
					width = 1280;
					height = 720;
				} break;

				case 2: {
					var width_value = document.getElementById("recordWidth").value;
					var height_value = document.getElementById("recordHeight").value;

					if (width_value == '' || width_value == null || width_value == undefined) {
						alert("请输入录像分辨率");
						return;
					}

					if (height_value == '' || height_value == null || height_value == undefined) {
						alert("请输入录像分辨率");
						return;
					}

					//用户自定义录像分辨率
					width = parseInt(width_value);
					height = parseInt(height_value);

				} break;
			}

			var jsonMsg = {
				id: 131,
				index: record_camera_index,
				width: width,
				height: height,
				file: file.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//开启录像反馈，格式：{"id": 132, "error": 错误代码}
		function CZUR_ID_StartRecord_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					var record_camera_index = document.getElementById("recordDevtype").selectedIndex;

					if (0 == record_camera_index) {
						m_process_type = 0;
						is_draw_m_frame = true;
					}
					else if (1 == record_camera_index) {
						s_process_type = 0;
						is_draw_s_frame = true;
					}
					else {
						is_draw_ir_frame = true;
					}
					txtlog.value = "开启录像成功，正在进行录制\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "发生异常错误，无法开启录像\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "正在录像或人脸识别，无法再次录像\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持副摄像头\r\n" + txtlog.value;
				} break;

				case 11: {
					txtlog.value = "无效摄像头序号\r\n" + txtlog.value;
				} break;

				case 12: {
					txtlog.value = "摄像头已打开\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "未检测到音频设备，无法开启录像\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头尚未打开\r\n" + txtlog.value;
				} break;

				case 27: {
					txtlog.value = "无效录像文件格式(仅支持MP4)\r\n" + txtlog.value;
				} break;

				case 28: {
					txtlog.value = "创建录像文件失败，请检查路径是否正确\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		//停止录像，格式: {"id": 133}
		function CZUR_ID_StopRecord() {
			var record_camera_index = document.getElementById("recordDevtype").selectedIndex;
			var jsonMsg = {
				id: 133,
				index: record_camera_index,
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置旋转角度反馈，格式：{"id": 134, "error": 错误代码}
		function CZUR_ID_StopRecord_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {

					var record_camera_index = document.getElementById("recordDevtype").selectedIndex;

					if (0 == record_camera_index) {
						is_draw_m_frame = false;
						m_ctx_frame.fillStyle = "#000000";
						m_ctx_frame.beginPath();
						m_ctx_frame.fillRect(0, 0, m_cav_frame.width, m_cav_frame.height);
						m_ctx_frame.closePath();
					} else if (1 == record_camera_index) {
						is_draw_s_frame = false;
						s_ctx_frame.fillStyle = "#000000";
						s_ctx_frame.beginPath();
						s_ctx_frame.fillRect(0, 0, s_cav_frame.width, s_cav_frame.height);
						s_ctx_frame.closePath();
					}
					else {
						is_draw_ir_frame = false;
						ir_ctx_frame.fillStyle = "#000000";
						ir_ctx_frame.beginPath();
						ir_ctx_frame.fillRect(0, 0, ir_cav_frame.width, ir_cav_frame.height);
						ir_ctx_frame.closePath();
					}

					txtlog.value = "成功停止录像\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 82: {
					txtlog.value = "尚未开启录像，无需停止\r\n" + txtlog.value;
				} break;
			}
		}

		//设置旋转角度，格式：{"id": 17, "angle": 旋转角度}
		function CZUR_ID_SetAngle() {
			var angle = 0;
			switch (document.getElementById("rotateangle").selectedIndex) {
				case 0:
					{
						angle = 0;
					}
					break;
				case 1:
					{
						angle = 90;
					}
					break;
				case 2:
					{
						angle = 180;
					}
					break;
				case 3:
					{
						angle = 270;
					}
					break;
			}

			var jsonMsg = {
				id: 17,
				angle: angle
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置旋转角度反馈，格式：{"id": 18, "error": 错误代码}
		function CZUR_ID_SetAngle_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {

					//获取当前用户设置的旋转角度
					var angle = 0;
					switch (document.getElementById("rotateangle").selectedIndex) {
						case 0: {
							angle = 0;
						} break;

						case 1: {
							angle = 90;
						} break;

						case 2: {
							angle = 180;
						} break;

						case 3: {
							angle = 270;
						} break;
					}

					m_ctx_frame.restore();

					//清空画布
					m_ctx_frame.clearRect(0, 0, m_cav_frame.width, m_cav_frame.height);

					//设置旋转中心点
					var x = m_cav_frame.width / 2;
					var y = m_cav_frame.height / 2;

					m_ctx_frame.save();
					m_ctx_frame.translate(x, y);
					m_ctx_frame.rotate(angle * Math.PI / 180);
					if ((angle == 90) || (angle == 270)) {
						m_ctx_frame.scale(y / x, y / x);
					}
					else {
						m_ctx_frame.scale(1, 1);
					}
					m_ctx_frame.translate(-x, -y);

					txtlog.value = "设置旋转角度成功\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头尚未打开\r\n" + txtlog.value;
				} break;

				case 22: {
					txtlog.value = "无效的旋转角度\r\n" + txtlog.value;
				} break;
			}
		}

		//设置主头纸张处理方式，格式：{"id": 19, "type": 处理方式, "left": left位置, "top": top位置, "right": right位置, "bottom": bottom位置}
		function CZUR_ID_SetProcessType() {
			var obj = document.getElementById("paperproc");
			var paper = obj.options[obj.selectedIndex].text;
			if (paper == "不处理") {
				m_process_type = 0;
			} else if (paper == "手动框选裁剪") {
				m_process_type = 1;
			} else if (paper == "自动裁剪黑边") {
				m_process_type = 2;
			} else if (paper == "曲面展平") {
				m_process_type = 3;
			} else if (paper == "展平拆分左右页") {
				m_process_type = 4;
			} else if (paper == "展平平分左右页") {
				m_process_type = 12;
			} if (paper == "拆分后保留左页") {
				m_process_type = 5;
			} if (paper == "拆分后保留右页") {
				m_process_type = 6;
			}

			//对于手动框选裁剪，默认一个框选裁剪位置
			if (1 == m_process_type) {
				m_left = 0.2 * m_cav_frame.width;
				m_top = 0.2 * m_cav_frame.height;
				m_right = 0.8 * m_cav_frame.width;
				m_bottom = 0.8 * m_cav_frame.height;
			}

			//计算区域占据显示窗口的百分比
			var left = 1.0 * m_left / m_cav_frame.width;
			var top = 1.0 * m_top / m_cav_frame.height;
			var right = 1.0 * m_right / m_cav_frame.width;
			var bottom = 1.0 * m_bottom / m_cav_frame.height;

			var cmd = '{\"id\": 19, \"type\": ' + m_process_type + ', \"left\": ' + left + ', \"top\": ' + top + ', \"right\": ' + right + ', \"bottom\": ' + bottom + '}';
			ws_cmd.send(cmd);
		}
		//设置主头纸张处理方式反馈，格式：{"id": 20, "error": 错误代码}
		function CZUR_ID_SetProcessType_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "设置纸张处理方式成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "录像期间，无法设置纸张处理方式\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设置不支持当前纸张处理方式\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头尚未打开，无法纸张处理方式\r\n" + txtlog.value;
				} break;

				case 23: {
					txtlog.value = "无效的纸张处理方式\r\n" + txtlog.value;
				} break;

				case 49: {
					txtlog.value = "无效的手动框选裁剪区域\r\n" + txtlog.value;
				} break;
			}
		}

		//设置副头纸张处理方式，格式：{"id": 21, "type": 处理方式, "left": left位置, "top": top位置, "right": right位置, "bottom": bottom位置}
		function CZUR_ID_SetProcessType2() {
			s_process_type = document.getElementById("paperproc2").selectedIndex;

			//对于手动框选裁剪，默认一个框选裁剪位置
			if (1 == s_process_type) {
				s_left = 0.2 * s_cav_frame.width;
				s_top = 0.2 * s_cav_frame.height;
				s_right = 0.8 * s_cav_frame.width;
				s_bottom = 0.8 * s_cav_frame.height;
			}

			//计算区域占据显示窗口的百分比
			var left = 1.0 * s_left / s_cav_frame.width;
			var top = 1.0 * s_top / s_cav_frame.height;
			var right = 1.0 * s_right / s_cav_frame.width;
			var bottom = 1.0 * s_bottom / s_cav_frame.height;

			var cmd = '{\"id\": 21, \"type\": ' + s_process_type + ', \"left\": ' + left + ', \"top\": ' + top + ', \"right\": ' + right + ', \"bottom\": ' + bottom + '}';
			ws_cmd.send(cmd);
		}
		//设置副头纸张处理方式反馈，格式：{"id": 22, "error": 错误代码}
		function CZUR_ID_SetProcessType2_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					txtlog.value = "设置纸张处理方式成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "录像期间，无法设置纸张处理方式\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "副摄像头未开启，无法纸张处理方式\r\n" + txtlog.value;
				} break;

				case 23: {
					txtlog.value = "无效的纸张处理方式\r\n" + txtlog.value;
				} break;

				case 49: {
					txtlog.value = "无效的手动框选裁剪区域\r\n" + txtlog.value;
				} break;
			}
		}

		//设置翻页检测，格式：{"id": 23, "detect": 0/1}
		function CZUR_ID_SetTurnDetect() {
			var on = 0;
			if (document.getElementById("turndetect").checked) {
				on = 1;
			}

			var jsonMsg = {
				id: 23,
				detect: on
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置翻页检测反馈，格式：{"id": 24, "error": 错误代码}
		function CZUR_ID_SetTurnDetect_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "设置翻页检测成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "录像期间，无法设置翻页检测\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持翻页检测功能\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "摄像头尚未打开，无法设置翻页检测\r\n" + txtlog.value;
				} break;
			}
		}

		//设置残缺页面补全，格式：{"id": 57, "on": 0/1}
		function CZUR_ID_SetPageFill() {
			var on = 0;
			if (document.getElementById("pagefill").checked) {
				on = 1;
			}

			var jsonMsg = {
				id: 57,
				on: on
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置残缺页面补全反馈，格式：{"id": 58, "error": 错误代码}
		function CZUR_ID_SetPageFill_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					txtlog.value = "设置残缺页面补全成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "录像期间，无法设置残缺页面补全\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设置不支持残缺页面补全功能\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未开启，无法进行设置\r\n" + txtlog.value;
				} break;
			}
		}

		//设置修复残留黑边，格式: {"id": 108, "repair": 0/1}
		function CZUR_ID_SetEdgeRepair() {
			var repair = 0;
			if (document.getElementById("pagefill").checked) {
				repair = 1;
			}

			var jsonMsg = {
				id: 108,
				repair: repair
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置修复残留黑边反馈，格式: {"id": 109, "error": 错误代码}
		function CZUR_ID_SetEdgeRepair_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					txtlog.value = "设置修复残留黑边成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "正在录像或人脸识别，无法设置\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未开启，无法设置\r\n" + txtlog.value;
				} break;
			}
		}

		//设置拍照保存图像白背景转透明，格式: {"id": 141, "on": 0/1}
		function CZUR_ID_SetWhiteTransparent() {
			var on = 0;
			if (document.getElementById("whitetransparent").checked) {
				on = 1;
			}

			var jsonMsg = {
				id: 141,
				on: on
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置拍照保存图像白背景转透明反馈，格式: {"id": 142, "error": 错误代码}
		function CZUR_ID_SetWhiteTransparent_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					txtlog.value = "设置成功\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "正在录像或人脸识别，无法设置\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "主摄像头尚未开启，无法设置\r\n" + txtlog.value;
				} break;
			}
		}

		//打开密码键盘，格式：{"id": 52, "mask": 掩码}
		function CZUR_ID_PK_OpenDevice() {
			var jsonMsg = {
				id: 52,
				mask: 0
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//打开密码键盘反馈，格式：{"id": 53, "error": 错误代码}
		function CZUR_ID_PK_OpenDevice_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "等待密码输入\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法打开密码键盘\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 12: {
					txtlog.value = "密码键盘已打开，等待密码输入\r\n" + txtlog.value;
				} break;

				case 15: {
					txtlog.value = "打开密码键盘失败，请检查密码键盘是否连接\r\n" + txtlog.value;
				} break;
			}
		}

		//关闭密码键盘，格式：{"id": 54}
		function CZUR_ID_PK_CloseDevice() {
			var jsonMsg = {
				id: 54
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//关闭密码键盘反馈，格式：{"id": 55, "error": 错误代码}
		function CZUR_ID_PK_CloseDevice_Response(jsonObj) {
			txtlog.value = "已关闭密码键盘\r\n" + txtlog.value;
		}

		//图像合成为PDF文档，格式：{"id": 50, "image": "图像文件名称", "pdf": "PDF文件名称"}
		function CZUR_ID_ImageToPDF() {
			var image = document.getElementById("pdfimage");
			var pdf = document.getElementById("pdffile");

			var jsonMsg = {
				id: 50,
				image: image.value,
				pdf: pdf.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//图像合成为PDF文档反馈，格式：{"id": 51, "error": 错误代码}
		function CZUR_ID_ImageToPDF_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "合成PDF文件成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法合成PDF\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持合成PDF功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "非法的图像文件格式，仅支持JPG、BMP、PNG格式\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载图像文件失败，请检查图像文件路径是否有效\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存PDF文件失败，请检查PDF文件路径是否有效或当前PDF文档是否被打开\r\n" + txtlog.value;
				} break;

				case 37: {
					txtlog.value = "存在的PDF文档存在密码保护，无法合成\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_DeleteFiles_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "删除本地文件成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "删除本地文件发生异常错误\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_ImageToPDFEx() {
			var image = document.getElementById("pdfimage");
			var image2 = document.getElementById("pdfimage2");
			var image3 = document.getElementById("pdfimage3");
			var pdf = document.getElementById("pdffile");

			var jsonMsg = {
				id: 159,
				images: [image.value, image2.value, image3.value],
				pdf: pdf.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_DeleteFiles() {
			var image = document.getElementById("pdfimage");

			var jsonMsg = {
				id: 161,
				files: [image.value, image.value, image.value, image.value]
			};

			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_ImageToPDFEx_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "合成PDF文件成功\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法合成PDF\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持合成PDF功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "非法的图像文件格式，仅支持JPG、BMP、PNG格式\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "加载图像文件失败，请检查图像文件路径是否有效\r\n" + txtlog.value;
				} break;

				case 36: {
					txtlog.value = "保存PDF文件失败，请检查PDF文件路径是否有效或当前PDF文档是否被打开\r\n" + txtlog.value;
				} break;

				case 37: {
					txtlog.value = "存在的PDF文档存在密码保护，无法合成\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}



		//开启HTTP上传，格式：{"id": 28, "file": "本地文件名称", "url": "HTTP URL", "option": "form表单属性", "name": "服务器保存名称"}
		function CZUR_ID_Http_Create() {
			var file = document.getElementById("httpfile");
			var url = document.getElementById("httpurl");
			var opt = document.getElementById("httpopt");
			var name = document.getElementById("httpname");

			var jsonMsg = {
				id: 28,
				file: file.value,
				url: url.value,
				option: opt.value,
				name: name.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//开启HTTP上传反馈，格式：{"id": 29, "error": 错误代码}
		function CZUR_ID_Http_Create_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行HTTP上传，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行HTTP上传\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个HTTP上传任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		//停止HTTP上传，格式：{"id": 30}
		function CZUR_ID_Http_Delete() {
			var jsonMsg = {
				id: 30
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//停止HTTP上传反馈，格式：{"id": 31, "error": 错误代码}
		function CZUR_ID_Http_Delete_Response(jsonObj) {
			txtlog.value = "已停止HTTP上传\r\n" + txtlog.value;
		}

		//识别图片保存为文档文件，格式：{"id": 59, "image": "图像文件名称", "file": "文档名称"}
		function CZUR_ID_OCR_Document() {
			var image = document.getElementById("ocrimage1");
			var doc = document.getElementById("ocrdoc");

			var jsonMsg = {
				id: 59,
				image: image.value,
				file: doc.value
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//识别图片保存为文档文件反馈，格式：{"id": 60, "error": 错误代码}
		function CZUR_ID_OCR_Document_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行OCR，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个OCR任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持OCR功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接\r\n" + txtlog.value;
				} break;

				case 31: {
					txtlog.value = "无效的文档保存格式，仅支持Txt、Word、Excel、PDF\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转码失败\r\n" + txtlog.value;
				} break;
			}
		}

		//识别图片保存为文档文件(属于扩展接口)，格式：{"id": 112, "images": 图像文件数组, "language": "识别语言", "psm": 文档幅面, "quality": PDF质量, "file": "文档名称"}
		function CZUR_ID_OCR_DocumentEx() {
			var image = document.getElementById("ocrimage1");
			var image2 = document.getElementById("ocrimage2");
			var image3 = document.getElementById("ocrimage3");
			var doc = document.getElementById("ocrdoc");

			var psm = 0;
			switch (document.getElementById("psm").selectedIndex) {
				case 0://导出文档幅面为图像尺寸
					{
						psm = 0;
					}
					break;
				case 1: //导出文档自动检测幅面
					{
						psm = 1;
					}
					break;
				case 2: //导出文档为A3幅面
					{
						psm = 2;
					}
					break;
				case 3: //导出文档为A4幅面
					{
						psm = 3;
					}
					break;
				case 4: //导出文档为A5幅面
					{
						psm = 3;
					}
					break;
				case 5: //导出文档为B3幅面
					{
						psm = 3;
					}
					break;
				case 6: //导出文档为B4幅面
					{
						psm = 3;
					}
					break;
				case 7: //导出文档为B5幅面
					{
						psm = 3;
					}
					break;
			}

			var bSheet = 0;
			var sheet = document.getElementById("withsheet");
			if (sheet.checked) {
				bSheet = 1;
			}
			else {

			}

			//测试demo中仅演示识别一个图像文件，识别语言为中文简体+英文
			var cmd = '{\"id\": 112, ' +
				'\"images\": [ {\"file\": \"' + image.value + '\"}, ' + '{\"file\": \"' + image2.value + '\"}, ' + '{\"file\": \"' + image3.value + '\"} ' + '], ' +
				'\"language\": \"ChinesePRC,English\", \"psm\": ' + psm + ', \"quality\": 80, ' + '\"file\": \"' + doc.value + '\", \"sheet\" : ' + bSheet + '}';
			ws_cmd.send(cmd);
		}
		//识别图片保存为文档文件(属于扩展接口)反馈，格式：{"id": 113, "error": 错误代码}
		function CZUR_ID_OCR_DocumentEx_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行OCR，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个OCR任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持OCR功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接\r\n" + txtlog.value;
				} break;

				case 21: {
					txtlog.value = "无效的PDF保存质量\r\n" + txtlog.value;
				} break;

				case 31: {
					txtlog.value = "无效的文档保存格式，仅支持Txt、Word、PDF、Excel格式\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转码失败\r\n" + txtlog.value;
				} break;

				case 78: {
					txtlog.value = "无效幅面参数\r\n" + txtlog.value;
				} break;
			}
		}

		//识别图片返回文本结果，格式：{"id": 70, "left": 0~100, "top": 0~100, "right": 0~100, "bottom": 0~100, "base64": 图像BASE64编码数据}
		function CZUR_ID_OCR_Text() {
			//图像的base64数据由测试页面提供，(实际开发由开发者自行获取图像的BASE64编码数据)
			var base64 = "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wgARCABVAbsDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAUCAwQGAf/EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/9oADAMBAAIQAxAAAAHvzxfNMTMGkWa10CpZnp1AnlctjlnF5sRbhnToBV7ebQW0WOTmNY8EbwCCA6ISejo5ew6QT4JvpznrM7eiHFrl1Yi0XLUF6sBLmOjEXg+KFo5Mi8diLGdSIfEfgKAAAeJ3Nc2v8Y55pIyYxaXrHc4zZnWSxLrY+M4snRym1dbU1xXUOK7EN7Wkxb5QJL2vouzM/RbBnqFazp8+eiwd+tJ8fRl5LbrNlzVDRBcGJxVCbXu9qOTVIkv3QmsQzqXLY0LzAFAAABI6xxkVdJI56bopBX01olUdbRjsik+0TrTojLp5eY0NROabs/Bak6aUIpdFGzm/OpivL7mchb6wi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bgFDKf7HgkkeNTBUcVVpDwuIFcpW2Swt0BEU4wpLa3RLQgyVrXgQhboW+kjFSnh3wtXqjSFq0XANNSjm72liArOhJpPUeFSwAXRUg7th++GcrwkicFKR16eap9hCjEp8RP1/5Ojr0S+xe1ftvPXqb+BNjnQePinGOpBCLw1DxUVkf1lVeimp7wlCg2AqAsgVhm8AIKWWft15lxMp0aax739HC/8MWKJ4PoYwthy2XWcy0GOAcxuESwPTR8SRMc5OpsgCJFOpSCyoAsJxJDpKiMCjwnwwzOFycgIEdn/wCvOJdhTX9iXtWuuu8F0sOQTVtS/Wu68sNdWyNIKMKXYW8RgXYIPY0/qD8cd2FQRvqAfxDPOOoSaAQIKz+eMqUhgXcOjrozlUexV0Jv1V4mVFrCP6OKTOm0Xy4/Xmcksa4hJRGISqQ3gLJCnCqVVnbX++b9eqBIogB6O+v3yHComrdWlr1yyVUhEtLcR/XOwZo0jLhlNcI1+vG/4J/FpCvZL7z0dxISB61ALLMs4AQUss/bryveLha7j5eeuFkN9/hfZ/43/9k=";

			var jsonMsg = {
				id: 70,
				left: 0,
				top: 0,
				right: 100,
				bottom: 100,
				base64: base64
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		//识别图片返回文本结果反馈，格式：{"id": 71, "error": 错误代码}
		function CZUR_ID_OCR_Text_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行OCR, 请稍后\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "发生异常错误，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个OCR任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持OCR功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接\r\n" + txtlog.value;
				} break;

				case 18: {
					txtlog.value = "无效的图像格式，仅支持JPG、BMP、PNG图像格式\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;

				case 58: {
					txtlog.value = "解码BASE64数据失败\r\n" + txtlog.value;
				} break;

				case 63: {
					txtlog.value = "无效的识别区域\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_OCR_TextEx() {

			var cmd = '{\"id\": 157, ' +
				'\"images\": [ {\"file\": \" d:\\1.jpg\"}, {\"file\": \" d:\\2.jpg\"}, {\"file\": \" d:\\3.jpg\"} ], ' +
				'\"language\": \"ChinesePRC,English\"' + '}';

			ws_cmd.send(cmd);
		}

		function CZUR_ID_OCR_TextEx_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行OCR，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个OCR任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持OCR功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接\r\n" + txtlog.value;
				} break;
			}
		}

		//识别证件，格式：{"id": 61, "image": "图像文件名称", "type": 识别类型}
		function CZUR_ID_OCR_Paperwork() {
			var image = document.getElementById("ocrimage2");
			var type = document.getElementById("ocrtype").selectedIndex;

			var jsonMsg = {
				id: 61,
				image: image.value,
				type: type
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//识别证件反馈，格式：{"id": 62, "error": 错误代码}
		function CZUR_ID_OCR_Paperwork_Response(jsonObj) {
			var error = jsonObj.error;
			switch (error) {
				case 0: {
					txtlog.value = "正在进行OCR，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法进行OCR\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "上一个OCR任务尚未结束\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持OCR功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接\r\n" + txtlog.value;
				} break;

				case 30: {
					txtlog.value = "无效识别类型\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转码失败\r\n" + txtlog.value;
				} break;
			}
		}

		//开启条码识别，格式: {"id": 102, "freq": 识别次数, "left": 识别区域左上点, "top":识别区域左上点, "right":识别区域右下点, "bottom":识别区域右下点, "flag": 1/2, "content": "JPG图像数据/JPG图像文件"}
		function CZUR_ID_BCR_Start() {
			var image = document.getElementById("bcrimage");

			//测试demo中仅演示对图像文件进行识别
			var cmd = '{\"id\": 102, \"freq\": 8, \"left\": 0.0, \"top\": 0.0, \"right\": 1.0, \"bottom\": 1.0, \"flag\": 2, \"content\": \"' + image.value + '\"}';
			ws_cmd.send(cmd);
		}
		//开启条码识别反馈，格式: {"id": 103, "error": 错误代码}
		function CZUR_ID_BCR_Start_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0:
					{
						txtlog.value = "正在进行条码识别，请稍后\r\n" + txtlog.value;
					}
					break;
				case 1:
					{
						txtlog.value = "异常错误，无法识别条码\r\n" + txtlog.value;
					}
					break;
				case 3:
					{
						txtlog.value = "系统内存不足\r\n" + txtlog.value;
					}
					break;
				case 4:
					{
						txtlog.value = "上一个条码识别未结束\r\n" + txtlog.value;
					}
					break;
				case 8:
					{
						txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
					}
					break;
				case 10:
					{
						txtlog.value = "设备不支持条码识别功能\r\n" + txtlog.value;
					}
					break;
				case 13:
					{
						txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
					}
					break;
				case 33:
					{
						txtlog.value = "加载JPG图像文件失败，请确认路径是否有效\r\n" + txtlog.value;
					}
					break;
				case 38:
					{
						txtlog.value = "非法的JPG图像格式\r\n" + txtlog.value;
					}
					break;
				case 43:
					{
						txtlog.value = "字符集转换失败，无法进行条码识别\r\n" + txtlog.value;
					}
					break;
				case 63:
					{
						txtlog.value = "不合法的识别区域\r\n" + txtlog.value;
					}
					break;
				case 70:
					{
						txtlog.value = "不合法的识别次数\r\n" + txtlog.value;
					}
					break;
				case 71:
					{
						txtlog.value = "非法的flag标记参数\r\n" + txtlog.value;
					}
					break;
			}
		}

		//停止条码识别，格式：{"id": 104}
		function CZUR_ID_BCR_Stop() {
			var jsonMsg = {
				id: 104
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//停止条码识别反馈，格式：{"id": 105, "error": 错误代码}
		function CZUR_ID_BCR_Stop_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "已停止条码识别\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 73: {
					txtlog.value = "尚未开启条码识别，无需停止\r\n" + txtlog.value;
				} break;
			}
		}

		//设置多目标裁剪，格式：{"id": 42, "image": "图像文件", "path": "保存路径", "prefix": "命名前缀", "number": 起始序号}
		function CZUR_ID_MultiObj_Clip() {
			var image = document.getElementById("mocimage");
			var prefix = document.getElementById("mocprefix");
			var number = parseInt(document.getElementById("mocnumber").value);
			var path = document.getElementById("mocpath");

			var jsonMsg = {
				id: 42,
				image: image.value,
				path: path.value,
				prefix: prefix.value,
				number: number
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}
		//设置多目标裁剪反馈，格式：{"id": 43, "error": 错误代码}
		function CZUR_ID_MultiObj_Clip_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "正在进行多目标裁剪，请稍后...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行多目标裁剪\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足，无法完成多目标裁剪\r\n" + txtlog.value;
				} break;

				case 7: {
					txtlog.value = "非法的保存路径\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 10: {
					txtlog.value = "设备不支持多目标裁剪功能\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 32: {
					txtlog.value = "非法的命名前缀\r\n" + txtlog.value;
				} break;

				case 33: {
					txtlog.value = "图像文件不存在\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_SelectFolder() {
			var jsonMsg = {
				id: 153
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_SelectFolder_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "请选择文件夹..." + "\r\n";
				} break;

				case 1: {
					txtlog.value = "发生异常错误\r\n" + txtlog.value;
				} break;

				case 2: {
					txtlog.value = "参数无效\r\n" + txtlog.value;
				} break;
				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;
				case 4: {
					txtlog.value = "正在选择文件夹，请稍后\r\n" + txtlog.value;
				} break;
			}
		}


		function CZUR_ID_SelectFile() {
			var jsonMsg = {
				id: 155
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_SelectFile_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "请选择文件..." + "\r\n";
				} break;

				case 1: {
					txtlog.value = "发生异常错误\r\n" + txtlog.value;
				} break;

				case 2: {
					txtlog.value = "参数无效\r\n" + txtlog.value;
				} break;
				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;
				case 4: {
					txtlog.value = "正在选择文件，请稍后...\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_DataReady_Response(jsonObj) {
			txtlog.value = "视频帧准备就绪\r\n" + txtlog.value;
		}

		function CZUR_ID_SelectResult_Response(jsonObj) {
			var error = jsonObj.error;
			var output = jsonObj.result;
			var func = jsonObj.func;

			switch (error) {
				case 0: {
					txtlog.value = "选择的结果是:" + output + "\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统资源不足\r\n" + txtlog.value;
				} break;

				case 43: {
					txtlog.value = "字符集转换失败\r\n" + txtlog.value;
				} break;

				case 85: {
					txtlog.value = "请执行基于加密机读取社保卡\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_ID_DataReady_Response(jsonObj) {
			txtlog.value = "视频帧准备就绪\r\n" + txtlog.value;
		}

		function CZUR_ID_SP_Evaluate() {
			var timeout = parseInt(document.getElementById("evatimeout").value);

			var jsonMsg = {
				id: 163,
				timeout: timeout
			};
			ws_cmd.send(JSON.stringify(jsonMsg));
		}

		function CZUR_ID_SP_Evaluate_Response(jsonObj) {
			var error = jsonObj.error;

			switch (error) {
				case 0: {
					txtlog.value = "请进行评价...\r\n" + txtlog.value;
				} break;

				case 1: {
					txtlog.value = "异常错误，无法进行评价功能\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "系统内存不足\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "正在进行签字或评价动作，请完成后重试\r\n" + txtlog.value;
				} break;

				case 8: {
					txtlog.value = "CZURPlugin环境未初始化\r\n" + txtlog.value;
				} break;

				case 13: {
					txtlog.value = "评价设备未连接，请将设备连接电脑\r\n" + txtlog.value;
				} break;

				case 14: {
					txtlog.value = "尚未开始评价\r\n" + txtlog.value;
				} break;
			}
		}

		function CZUR_EVENT_EVA_Status_Reply(jsonObj) {
			var status = jsonObj.status;

			switch (status) {
				case 1: {
					txtlog.value = "评价：非常满意\r\n" + txtlog.value;
				} break;

				case 2: {
					txtlog.value = "评价：满意\r\n" + txtlog.value;
				} break;

				case 3: {
					txtlog.value = "评价：一般\r\n" + txtlog.value;
				} break;

				case 4: {
					txtlog.value = "评价：不满意\r\n" + txtlog.value;
				} break;

				case 5: {
					txtlog.value = "评价：非常不满意\r\n" + txtlog.value;
				} break;

				case -1: {
					txtlog.value = "评价服务发生异常，已自动停止\r\n" + txtlog.value;
				} break;
			}
		}

	</SCRIPT>
</body>

</HTML>